Advertisement
Guest User

Untitled

a guest
May 8th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2. $c = 1; //init counter
  3. $bpr = 3; //boxes per row
  4. $wp_query = new WP_Query(array('showposts' => 9, 'orderby'=> 'rand', 'post_type' => array('actors',  'plays', 'schools', 'directors', 'producers', 'singers', 'theatres', 'history', 'technicians')));
  5. while( have_posts() ) : the_post(); ?>
  6.  
  7.  
  8.         <div class="post" id="post-<?php the_ID(); ?>">
  9.                 <p><?php $post_type = get_post_type_object( get_post_type($post) );
  10. echo $post_type->label ; ?></p>
  11. <a href="<?php the_permalink() ?>" rel="bookmark">
  12. <?php if ( has_post_thumbnail() ) {
  13. the_post_thumbnail('thumbnail');
  14. } else { ?>
  15. <img src="<?php bloginfo('template_directory'); ?>/img/fallback_image.jpg" alt="<?php the_title(); ?>" />
  16. <?php } ?>
  17. </a>
  18.             </div>
  19. <?php
  20. if($c == $bpr) :
  21. ?>
  22. <div class="clr"></div>
  23. <?php
  24. $c = 0;
  25. endif;
  26. ?>
  27. <?php
  28.         $c++;
  29.     endwhile;
  30. ?>
  31. <div class="clr"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement