conditional image thumbnail on main blog page
Hi, I am having a real issue with a website – I have managed to place thumbnails of post images on the front page of my website but some of the posts will not have images attached and at the moment that just leaves them with a blank space – I am very new to php and cannot code the appropriate if/else bit that excludes the thumbnail box when there isnt an image available.
This is what i have so far:
<?php $image = get_post_meta($post->ID, 'thumbnail', true); ?> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo $image; ?>" alt="" /></a>
I have tried various things but always end up bodging them.
some help would be most appreciated.
- The topic ‘conditional image thumbnail on main blog page’ is closed to new replies.