Advertisement
joshrodgers

Loop Issue

Jun 6th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php get_header(); ?>
  2.     <?php query_posts("orderby=rand&category_name=logos&posts_per_page=24"); ?>
  3.         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  4.             <div class="thumb">
  5.                 <?php if (in_category("logos")
  6.                     && $post == $posts[0]
  7.                         || in_category("logos")
  8.                     && $post == $posts[1]
  9.                         || in_category("logos")
  10.                     && $post == $posts[2]) {
  11.                 ?>
  12.                     <div class="new">
  13.                         <a href="<?php the_permalink(); ?>"><img src="<?php bloginfo("template_directory"); ?>/images/spacer.png" /></a>
  14.                     </div>
  15.                 <?php } ?>
  16.                 <?php if (has_post_thumbnail()) {
  17.                     the_post_thumbnail("thumb"); ?>
  18.                 <?php }
  19.                 else { ?>
  20.                     <img src="<?php bloginfo("template_directory"); ?>/images/thumb.jpg" />
  21.                 <?php } ?>
  22.             </div>
  23.         <?php endwhile; else: ?>
  24.             <p><?php _e("Sorry, no posts matched your criteria."); ?></p>
  25.         <?php endif; ?>
  26.     <?php wp_reset_query(); ?>
  27. <?php get_sidebar(); ?>
  28. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement