WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Display different quantities of post per page (1 post)

  1. certainstrings
    Member
    Posted 2 years ago #

    I've got the WP-PageNavi plugin working fine, but had a question about modifying how many posts are displayed per page.

    Here is the loop I'm using.

    <?php
              $args = array(
                'post_type' => 'commercial,
                'posts_per_page' => 4,
                'paged' => get_query_var('paged')
              );
    
              $my_query = new WP_Query( $args );
    
              while ( $my_query->have_posts() ) : $my_query->the_post();
            ?>
             <!-- post info here -->
    
            <?php endwhile; ?>

    My overall goal is to display 2 posts on the first page and 8 posts on any of the subsequent paginated pages. I've use the if_paged() method to modify the posts_per_page variable, but the pagination gets messed up. Has anyone had any results with something like this?

    http://wordpress.org/extend/plugins/wp-pagenavi/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by certainstrings
  • This topic is not resolved
  • WordPress version: 3.2.1