Problems displaying custom field data
I’ve been trying to create a “Featured Posts” widget for my homepage. This would use a category (featured-event) and would display some data from a couple of custom fields (featured_event_info and featured_event_title). I get the loop started fine, but none of the custom field values are showing. Any help would be greatly appreciated. I have some small knowledge of PHP but for the most part I am a designer. Thanks!
Here’s the code I’m using:
query_posts('category_name=featured-event&&showposts=3'); while (have_posts()) : the_post(); ?> <div class="featured-events-post"> <a title="<?php echo get_post_meta($post->ID, 'featured_event_title', true); ?>" href="<?php the_permalink() ?>" rel="bookmark"> <div class="featured-events-title"><?php echo get_post_meta($post->ID, 'featured_event_title', true); ?></div> <div class="featured-events-shortdata"><?php echo get_post_meta($post->ID, 'featured_event_info', true); ?></a> </div> <?php endwhile; ?>
And here’s a link to my development site:
- The topic ‘Problems displaying custom field data’ is closed to new replies.