Custom field in post is showing up on the blog page
-
I’m using this to show a div that stretches the whole window, showing a fully stretched image:
<?php $bg = get_post_meta($post->ID, bg, true); if($bg){ ?> <div id="page-background"><img src="<?php bloginfo( 'template_directory' ); ?>/images/<?php echo get_post_meta($post->ID, bg, true); ?>" alt="" width="100%" height="100%" /></div> <?php }else{ ?> <?php } ?>
Works great, but it if the first (and only first) post on the blog page has that custom field, the whole blog page gets the custom field.
Anyone know how to remedy this?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom field in post is showing up on the blog page’ is closed to new replies.