Custom Field Isn't Displaying
-
Hi,
In my footer I use this code:
<?php $posts = get_posts('cat=5&numberposts=3'); foreach ($posts as $post) : start_wp(); ?> <li><a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('thumbnail'); ?> <?php $postid = $wp_query->post->ID; echo get_post_meta($postid, 'Short Teaser', true); ?></a></li> <?php endforeach; ?>
Notice after the thumbnail, I’m pulling in a custom field called Short Teaser. This works on every page (though I’ve had previous issues). But on one of my category pages changing:
<?php if ( have_posts() ) : ?>
to
<?php if ( have_posts() ) : query_posts($query_string."&posts_per_page=2&paged=$paged"); ?>
By doing this, it means on this page it prevents the custom field from showing (thumbnail still displays). Anyone know how I can avoid this? I presume I can pull in the custom field in some other way to stop avoid the clashes I keep getting at every corner.
Thanks!
Matt
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Field Isn't Displaying’ is closed to new replies.