Displaying Custom Post Type Meta Data in Sidebar
-
I’ve created a custom post type for events using the Think Vitamin tutorial here: http://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/
It’s working great. I wanted the most recent three events to show up on the homepage in the sidebar and achieved it with this code:
[Code moderated as per the Forum Rules. Please use the pastebin]
Now I want to add the date above the excerpt, which is stored in a custom meta box. This code worked fine on the single-events.php page, but it won’t work in the sidebar for some reason:
<?php echo get_post_meta($post->ID, 'when',true); ?>
Help? Here’s the site URL: http://www.lisapaitzspindler.com/clwilson/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Displaying Custom Post Type Meta Data in Sidebar’ is closed to new replies.