How to display custom post titles?
-
I created a custom post type called Slides that are child posts to normal posts. Each post becomes a single slide in a slideshow to its parent.
I am having trouble displaying the slides’ titles within the parent post.
I’m able to get each slide’s custom fields’ values, I just can’t get the titles. Here’s the code I’m using and thought would work:
<?php if (get_post_meta($slide->ID, 'wpcf-image', true)) { $thetitle = get_post_meta($slide->ID, 'title', true); $image = get_post_meta($slide->ID, 'wpcf-image', true); $caption = get_post_meta($slide->ID, 'wpcf-caption', true); $credit = get_post_meta($slide->ID, 'wpcf-credit', true); ?>
All of the variables work except $thetitle.
Thank you in advance for any help!
- The topic ‘How to display custom post titles?’ is closed to new replies.