• Hi all

    For my portfolio custom post type, currently I am displaying 6 posts per page. Is there a way to change number of posts per page with click of a button or link?

    For example: If I click on “view all” it changes portfolio page with all the posts in that custom post type?

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter yuvin8

    (@yuvin8)

    <?php
    						$loop = new WP_Query( array( 'post_type' => 'people', 'paged' => get_query_var( 'paged' ), 'posts_per_page' => 9 ) );
    						if ( have_posts() ): while ( $loop->have_posts() ) : $loop->the_post();
    						?>

    This is my current code, which is setting posts per page to 9. I want to chnage to “N” (all) posts when I click on “View All”.

Viewing 1 replies (of 1 total)
  • The topic ‘Change Number of posts per page with button’ is closed to new replies.