You can use is_singular() with post types like this:
if( is_singular('event') ) {
// We are in single view of event post type
}
So, your code could be:
add_filter( 'the_title', 'event_page_title' );
function event_page_title( $title ) {
if ( is_singular( 'event' ) ) {
$title = "Title: " . $title;
}
return $title;
}
Related Posts:
- How do I filter a custom post type loop by a field?
- Filter page ID outside the loop and order
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Filter by custom field in custom post type on admin page
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- Display Authors Comments on Profile Page
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Category as Class for Custom Post Type
- WP Admin default view mode for Custom Post Type
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Exclude custom function content from certain pages
- Filter get_categories() for taxonomy term in WordPress
- Best way to style first post differently?
- How do I write this SQL statement for Posts written in last 24 hours?
- WooCommerce – Show orders for a specific product ? [closed]
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- How to append element after thumbnail
- Add $more_link_text parameter to the_excerpt()
- Display custom post on home page based on a metabox selection
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Lists Posts from CPT that match the Title of the Page
- How would I create a shortcode to display a custom post within a page or regular post?
- Remove duplicated values from a loop
- How to connect two custom post types with nested loops
- Normal pages as children of my Custom Post Type
- WooCommerce product search titles only
- Custom query to filter posts that have current post as a taxonomy [closed]
- Custom Post Type Loop throws 500 error when used in widget
- Genesis filterable portfolio isotope [closed]
- filter custom post type by meta key in dashboard
- Categories of custom taxonomy don’t show any posts
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- How to add a post slug to a url?
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Group CPT posts by custom taxonomy
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Display Custom Taxonomy Alphabetically
- Problem: wp_query outputs all images on site
- The loop seems stuck to a single (now deleted) post
- Custom Post Types strange pagination problem
- Custom post type conditional in loop
- Display custom post type posts first, then default posts
- Including all post id’s of a custom post type into an array
- Multiple Custom Post Type queries, how to DRY it up
- Main query not querying any posts in custom taxonomy template
- Filter posts by tax (dropdown) and meta value
- Loop through posts of only 2 statuses
- Add more than one custom post type to wordpress home page post loop
- Custom wordpress loop
- Trying to add a class to post links
- Use post in multiple places on a page with multiple posts
- List all Custom Post Type posts excluding certain Taxnomy term
- Catch and display error on save_post action
- Loop and add Specific Categories and Products Images
- How can I increase the post count for custom post types only?
- Custom post type pagination error
- Add custom post type to query
- Is possible register two archive pages for single custom post type?
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Custom post type paging return home page
- when looping through custom post data not appearing
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- Multiple Loops In Tabs Only Displaying First Loop
- How to only get the content of post page while looping?
- SEARCH QUERIES – REVERSE OUTPUT
- ACF meta_key and meta_value break loop
- post_type incorrect for custom post type
- Skip latest 3 posts from loop
- Staggering featured post using ‘sticky’
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- How to build Custom Post Nav Menu inside of the Loop
- Loop to display parent categories in custom taxonomy
- Custom taxonomy template for custom fields loop [closed]
- Sort loop by custom field from different post type
- next_posts_link() always generates second page link on custom post type
- Display related post content and custom field content
- Show posts for current taxonomy
- Add filter button to custom post type in admin area
- WordPress loop, show only one post per custom field
- How To Loop Through list with Custom Post Types
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Adding Information To All Posts Screen
- Multiple loops for custom post type to spread data across rows
- Custom Post Type + Category archive
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Posts without featured image using other post’s featured image
- Get result from Custom Field in Custom Post type
- Nested loop called with shortcode duplicating the content above the main loop
- Custom post-type’s pagination not working in category.php
- Pulling in a particular post into a single page based on the post id passed into the code
- why get_post_meta is returning 0?
- Get Posts From A Certain Post Type In An ID Array
- Show search for data extracted from metabox
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Add post id to url instead of WordPress default -2 suffix