PhpTips.im - Everything about php - Download CMS, find tips and tricks, code snippetz, classes and more and more...
Bookmark this page !
   

Articles

    Home » Articles » PHP Snippets » Display Thumbnails Next To Your Posts
Published on : 15.05.2010 Category : PHP Snippets Viewed : 71 times.

Code:


  1. <?php $postimageurl = get_post_meta($post->ID, 'post-img', true);
  2. if ($postimageurl) {
  3. ?>
  4. <a href="<?php the_permalink(); ?>" rel="bookmark"><img src="<?php echo $postimageurl; ?>" alt="Post Pic" width="200" height="200" /></a>
  5. <?php } else { ?>
  6. <a href="<?php the_permalink(); ?>" rel="bookmark"><img src="<?php bloginfo('template_url'); ?>/images/wprecipes.gif" alt="Screenshot" width="200" height="200" /></a>
  7. <?php } ?>



Add this article in :

 

There is not yet any comment !



1089 Rating: 0.0/10 (0 votes cast)

 

 Members
Log In !
Email Address :

Password :


Change my passowrd !
Sign Up !
We have : 3 members.
Latest member : albans
 
 Last Posts
 
 Advertising
 
©PhpTips.im 2010
Powered by PikaCMS.
Quick Links :
Home | Browse all articles | Downloads | Terms of Use
RSS RSS 2.0 : Articles | Downloads ATOM : Articles | Downloads