Created
January 3, 2013 06:38
-
-
Save duard/4441293 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="work"> | |
| <ul class="thumbnails"> | |
| <?php $loop = new WP_Query( array( 'post_type' => 'work', 'posts_per_page' => 9 ) ); ?> | |
| <?php $i = 0; // starts the counter ?> | |
| <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> | |
| <?php if ($i % 3 == 0 ) { | |
| echo '<li class="span4" style="clear:left;">'; // clear left if start of new row. | |
| } else { | |
| echo '<li class="span4">'; // continuation of a row, no need to clear left. | |
| } | |
| ?> | |
| <div class="post"> | |
| <div class="thumbnail"> | |
| <a href="<?php the_permalink() ?>"><div class="tint"><?php the_post_thumbnail( 'featured-thumb' ); ?></div></a> | |
| <br /> | |
| <div class="thumbcaption"> | |
| <a href="<?php the_permalink() ?>"><h3><?php the_title() ?></h3></a> | |
| <p> <?php the_excerpt(); ?></p> | |
| <p><i><?php the_terms( $post->ID, 'work_project_type' , ' ' ); ?></i></p> | |
| </div> | |
| </div> | |
| </div> | |
| </li> | |
| <?php $i++; // increments the counter ?> | |
| <?php endwhile; ?> | |
| </ul> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment