Home > Mobile >  wordpress pagination between pages
wordpress pagination between pages

Time:02-26

I found a lot of way to paginate posts but what I didnt find is that if it is possible to have a pagination between pages.

I am looking for a plugin which set pagination at the bottom, and I could set a page for each pagination item. For example number 1 and number 2 would be a completely different page.

Does anyone tried to achieve this behaviour?

CodePudding user response:

You could something like this (based on this answer):

$the_query = new WP_Query(
    array(
        'posts_per_page'=>30,
        'post_type'=>'page',
        'paged' => get_query_var('paged') ? get_query_var('paged') : 1)
);

$big = 999999999; // need an unlikely integer
echo paginate_links( 
    array(
        'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
        'format' => '?paged=%#%',
        'current' => max( 1, get_query_var('paged') ),
        'total' => $the_query->max_num_pages
    ) 
);

wp_reset_postdata();
  • Related