Created
July 20, 2012 20:05
-
-
Save nikibrown/3152904 to your computer and use it in GitHub Desktop.
Add somethign before and after every group of 4 posts...
This file contains 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
<?php $tombstones = new WP_Query('category_name=tombstones&posts_per_page=-1'); ?> | |
<?php $counter = 0; ?> | |
<?php if( $tombstones->have_posts()) : ?> | |
<?php while ( $tombstones->have_posts() ) : $tombstones->the_post(); ?> | |
<?php $counter++; ?> | |
<?php if ($counter % 4 == 0) echo '<div class="slide"><h1>Beginning</h1>'; ?> | |
<?php the_content(); ?> | |
<?php if ($counter % 4 == 0) echo '<h1>Ending</h1></div>'; ?> | |
<?php endwhile; endif;?> | |
<?php wp_reset_postdata(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this