This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

pagination with siteorigin posts loop

8 years ago

Hi Want to congratulate you first for this amazing plugin.
I discover the post selector but I have one question how do you add a pagination to the post args.
I try with

$processed_query = siteorigin_widget_post_selector_process_query( $post_selector_pseudo_query );
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$processed_query['paged'] = $paged;
$query_result = new WP_Query( $processed_query );

but when I try to display the pagination with :

<?php if ($query_result->max_num_pages > 1) { // check if the max number of pages is greater than 1  ?>
  <nav class="prev-next-posts">
    <div class="prev-posts-link">
      <?php echo get_next_posts_link( 'Older Entries', $query_result->max_num_pages ); // display older posts link ?>
    </div>
    <div class="next-posts-link">
      <?php echo get_previous_posts_link( 'Newer Entries' ); // display newer posts link ?>
    </div>
  </nav>
<?php } ?>

it fails.
Thanks

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Have a different question or issue?

Start New Thread