get_post_meta help
-
I need some help here.. I’m using a theme called ‘moneyzine’ on moneysinternet.com.
The theme displays images next to posts. These images are linked via a custom field called ‘screen’ that you add to your posts.
The problem comes up with you don’t add that custom field to the post, a black image shows up. I’d like a default image to show up.
The coding that displays the image is in the index.php file under the theme.. It goes like this:
<div class=”entry”>
<?php $screen = get_post_meta($post->ID,’screen’, true); ?>
<?php $screen = get_post_meta($post->ID,’screen’, false); ?>
<img src=”<?php echo ($screen); ?>” width=”160″ height=”100″ alt=”” />
<?php the_content_limit(600, “”); ?>
<div class=”clear”></div>
</div>what would i change to get this display a default image if no custom image is defined?
- The topic ‘get_post_meta help’ is closed to new replies.