Advertisement
Guest User

Untitled

a guest
Aug 10th, 2010
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php /*
  2. Post Thumbnail Template
  3. Author: Zach Dunn (www.buildinternet.com)
  4. */
  5. ?>
  6.  
  7. <h2 class="meta">Related Templates</h2>
  8.  
  9. <?php if ($related_query->have_posts()):?>
  10.  
  11.  
  12.  
  13. <ol class="related-posts">
  14. <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
  15.  
  16. <?php
  17. //Set Default Thumbnail Image URL's
  18. $related_thumbnail = get_post_meta($post->ID, "image", $single = true);
  19. $default_thumbnail = 'default-related-thumbnail.jpg';
  20. ?>
  21.  
  22. <center><li>
  23. <a href="<?php the_permalink() ?>" rel="bookmark">
  24. <?php if ($related_thumbnail != "") : ?>
  25. <img src="<?php echo $related_thumbnail; ?>" alt="<?php the_title(); ?>"width="120" height="120" />
  26. <?php else : ?>
  27. <img src="<?php echo bloginfo('template_url'); ?>/<?php echo $default_thumbnail; ?>" alt="<?php the_title(); ?>" />
  28. <?php endif; ?>
  29.  
  30. <?php the_title(); ?></a>
  31. </li></center>
  32.  
  33. <?php endwhile; ?>
  34. </ol>
  35.  
  36. <div class="clear">&nbsp;</div>
  37.  
  38. <?php else: ?>
  39.  
  40. <p>No related posts found</p>
  41.  
  42. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement