Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $c = 1; //init counter
- $bpr = 3; //boxes per row
- $wp_query = new WP_Query(array('showposts' => 9, 'orderby'=> 'rand', 'post_type' => array('actors', 'plays', 'schools', 'directors', 'producers', 'singers', 'theatres', 'history', 'technicians')));
- while( have_posts() ) : the_post(); ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <p><?php $post_type = get_post_type_object( get_post_type($post) );
- echo $post_type->label ; ?></p>
- <a href="<?php the_permalink() ?>" rel="bookmark">
- <?php if ( has_post_thumbnail() ) {
- the_post_thumbnail('thumbnail');
- } else { ?>
- <img src="<?php bloginfo('template_directory'); ?>/img/fallback_image.jpg" alt="<?php the_title(); ?>" />
- <?php } ?>
- </a>
- </div>
- <?php
- if($c == $bpr) :
- ?>
- <div class="clr"></div>
- <?php
- $c = 0;
- endif;
- ?>
- <?php
- $c++;
- endwhile;
- ?>
- <div class="clr"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement