Last post in row have different style
-
Hello, how to do that last post per row have different style?
<?php get_header(); ?> <?php // Show a selected number of posts per row $posts_per_row = 4; $posts_per_page = 8; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => $posts_per_page, 'paged' => $paged, ); query_posts($args); if (have_posts()) { while (have_posts()) { the_post(); if ((++$post_counter % $posts_per_row) == 1 || $posts_per_row == 1) { if ($post_counter > 1) { echo "</div><!-- End of post_row -->\n"; // End previous row } echo "<div class='post_row'>\n"; // Start a new row } echo "<div class='post_class'>\n"; // Start one post // Output post data here echo '<h2>';the_title();echo '</h2>'; the_excerpt(); echo "</div><!-- End of post_class -->\n"; // End of post } ?> </div><!-- End of post_row --> <div style='clear:both;'></div> <div> <div><?php next_posts_link('« Older Entries') ?></div> <div><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php } else { // Code for no posts found } ?> <div style='clear:both;'></div> <?php get_footer(); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Last post in row have different style’ is closed to new replies.