If you do something like:
$custompost = get_post(get_the_ID());
echo $custompost->post_title;
You’ll find it works. There’s clearly a bug somewhere inside the WordPress core – this is happening to me too for a custom post type. Not sure what triggers it, but the above is a workaround.
Related Posts:
- Replacing the title in admin list table
- Replacing the title in admin list table
- the_title filter returning wrong post type
- Custom post type title is set by other custom post type
- Display post content with respect to its title?
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- the_title not working
- Random Custom Post Type Titles
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- Is it possible to create 2 unique titles for an Events custom post type: Upcoming Events and Past Events?
- Display title of custom post type dynamically
- Remove space when post title is blank
- How to Add Tags to Custom Post Type?
- How come Featured Image isn’t showing up in my Custom Post Type?
- Adding ‘menu order’ column to custom post type admin screen
- Renaming Custom Post Types and Taxonomies
- Mixing regular and custom post types (with meta_query) on home page
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post type support for get_users(‘orderby=post_count’);
- Seperating Custom Post Search Results
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Adding custom post type to loop
- Use WP_Query object inside a function
- WP_Query search custom posts meta date fields
- How can I add dropdown widget/box to admin post page?
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Debug output during filter execution doesn’t work
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- Listing and accessing categories for a custom post type
- Disable adding of new post (custom post type)
- Taxonomy posts on Archive page
- Creating a simple pagination for custom post type templates
- No results searching custom post type in admin panel
- Custom content type meta_box_cb does not run
- WP_Query tax_query on ACF post_object
- Show hierarchical relationship between to custom post types on admin list
- CPT’s archive and single page not working [closed]
- Do i need to keep register_post_type in functions.php?
- Display multiple custom post types and sort them chronological by one of their fields
- Using DISTINCT in wp_query
- Received nothing after executing AJAX post function
- How to modify archive query with pre_get_posts to append CPTs?
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Mapping Subdomains in WordPress to give the appearance of a localised site, best approach?
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Metabox not show in categories custom post type cmb2
- Categorize custom post type
- Polylang non-default language ignores tags in WP_Query
- WP-API select custom taxonomy when creating a post
- Breadcrumb Not Linking to the Correct Custom Post Type Index Page(s)
- List of Posts and Categories
- Custom Post Types in the WordPress Navigation Menu
- Add a permalink variable onto custom post type URL after post name slug
- How to Set Taxonomy Object Description?
- Show only public custom posts in home page
- Add term list as class
- Custom Post type collection
- new WP_query > displays posts only once instead of running through full array
- get_terms() parent, child and grandchild
- Multi Parameter search with custom post type category and tag
- Adding Menu Items in Custom Post Types
- Set generic reservation form for custom post type
- Custom PT, Taxonomys and wordpress query
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- users post count
- Custom post type with rewrite slug as / has 404 issue in other post type. How to fix this issue
- How to hide list from custom post type
- Order admin post list table by meta field, and have posts without the meta field always be at the end of the list
- Having hierarchies inside WordPress custom post type
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- How to display grandchildren only of custom post?
- WP_Query based on ‘s’ and tax_queries
- get_post_meta not working with variable as a post_id for dynamically get the postid
- Dropdown of existing posts in a metabox
- The page or ad listing you are trying to reach no longer exists or has expired
- Custom post type category link + add to menu
- Keep br tags from stripping
- Display featured images from custom post type in the homepage template
- php output of generated custom metabox
- Taxonomy and Custom Post type with Collpase
- Shortcode error
- Custom Post Type parent slug as menu item
- Advanced Custom Fields – Add Field to Specific Page [closed]
- Query child posts on parents single.php?
- custom post type for custom talbe
- Post being scheduled that shouldnt be schedulded
- Template with Custom Post Type (Custom Tables) does not work
- How to add a post counter to the list of custom taxonomy terms?
- Custom Post Type and Taxonomy pagination permalink
- Author template – separate custom post type by custom taxonomy term for $curauth
- Ordering custom posts
- Custom post type – update_meta not working
- Customising wordpress search and using $_GET[“s”]
- Dealing with variables with gettext function
- how do I create a breadcrumb to work with multiple custom taxonomies
- Where do I insert to? [closed]
- WooCommerce – Complete Order when an action occurs
- A call to list all Custom Post Types?
- How to debug a 404 error on pages whose content is perfectly displayed when I explore it?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages