Return to Snippet

Revision: 37070
at December 3, 2010 05:46 by Farhan


Initial Code
<?php $thereisimage = get_post_meta($post->ID, image, true);
if($thereisimage){ ?>
	<a href="<?php the_permalink() ?>"><img src="<?php echo get_post_meta($post->ID, image, true); ?>" alt="Image" /></a>
<?php }else{ ?>
	<a href="<?php the_permalink() ?>"><img src="images/default.png" alt="Default Image" /></a>
<?php } ?>

Initial URL


Initial Description


Initial Title
Check if Custom Field Exist

Initial Tags
wordpress

Initial Language
PHP