Can someone help me? I'm trying to set a thumbnail to the left of a post summary on a category page, but it doesn't seem to recognize my custom field. I've set the custom field to 'post-img' on the post page. Then I've added this code to the content-extensions.php page within the Categy Loop before the <div id="post-
<?php $postimageurl = get_post_meta($post->ID, 'post-img', true);
if ($postimageurl) {
?>
<a href="<?php the_permalink(); ?>" rel="bookmark"><img src="<?php echo $postimageurl; ?>" alt="Post Pic" /></a>
<?php } else { ?>
<a href="<?php the_permalink(); ?>" rel="bookmark"><img src="/wp-content/themes/lonjevitea/images/default.gif" alt="Screenshot" width="200" height="150" /></a>
<?php } ?>
For some reason the custom field is not working. It shows the default image okay, but does not recognize that I have a post-img value in there. Can someone help? Or show me better way to do this?
Thanks!