I am trying to output demo and download links for posts using custom fields if its required.
Here is the sample code
<?php if( get_post_meta($post->ID, "demo", true) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<div class="demo" src="<?php echo get_post_meta($post->ID, "demo", true) ?>" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
Help me, whats making wrong with this code