Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 15th, 2011  |  syntax: PHP  |  size: 1.53 KB  |  views: 95  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php /*
  2. Example template for use with post thumbnails
  3. Requires WordPress 2.9 and a theme which supports post thumbnails
  4. Author: mitcho (Michael Yoshitaka Erlewine)
  5. */ ?>
  6.  
  7. <h6 class="naslov">Srodni postovi</h6>
  8. <?php if (have_posts()):?>
  9.         <ul id="rp_posts_slicni">
  10.                 <?php while (have_posts()) : the_post(); ?>
  11.                 <li>
  12.                         <a href="<?php the_permalink(); ?>" class="related-title">
  13.                         <div class="related-image-container">
  14.                                 <div style="background: url(<?php if( get_post_meta($post->ID, "thumb", true) ): ?>
  15.                         <?php echo THEME_INC; ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, 'thumb', $single = true); ?>&amp;h=105&amp;w=105&amp;zc=1
  16.                         <?php elseif ((preg_match("/ggpht.com/i", getImage('1'))) || preg_match("/blogspot.com/i", getImage('1'))): ?>
  17.                         <?php echo THEME_INC; ?>/timthumb.php?src=<?php echo getImage('1'); ?>&amp;h=105&amp;w=105&amp;zc=1
  18.                         <?php elseif(!getImage('1') == ""): ?>
  19.                         <?php echo THEME_INC; ?>/timthumb.php?src=<?php echo getImage('1'); ?>&amp;h=105&amp;w=105&amp;zc=1
  20.                         <?php elseif(!$iNumberOfPics > 0 ): ?>
  21.                         <?php echo THEME_INC; ?>/timthumb.php?src=http://img.youtube.com/vi/<?php echo get_yt_thumb($post->post_content); ?>/hqdefault.jpg&amp;h=105&amp;w=105&amp;zc=1
  22.                         <?php else: ?>
  23.                         <?php echo THEME_INC; ?>/timthumb.php?src=<?php echo THEME_IMAGES; ?>/wp.png&amp;h=105&amp;w=105&amp;zc=1
  24.                         <?php endif; ?>) no-repeat center center">
  25.                                 </div>
  26.                         </div>
  27.                         <?php the_title(); ?></a>
  28.                 </li>
  29.                 <?php endwhile; ?>
  30.         </ul>
  31. <?php else: ?>
  32. <p>Nema srodnih postova.</p>
  33. <?php endif; ?>
clone this paste RAW Paste Data