OffesetPagination Not Working in Posts Widget When Using Offset
-
Hello,
I am using your plugin and overall it works well, but I am facing an issue with the Posts Widget pagination when using the Offset option.
On my category/tag archive page, I have created two post lists:
- Top section – displays the latest single post.
- Bottom section – displays the remaining posts with pagination.
To exclude the first post from the second list, I used the Offset = 1 option in the query settings. However, when Offset is set to 1, the pagination does not work correctly. When I navigate to page 2, 3, etc., it keeps loading the same posts instead of the correct paginated results.
If I remove the Offset or set it to 0, the pagination works normally.
I am also using the Custom Query ID option with the following code to filter posts based on the current taxonomy term:
function bpfwe_by_post_status( $query ) { $term = get_queried_object(); if ( $term && isset( $term->taxonomy ) ) { $tax_query[] = $query->get('tax_query'); $tax_query[] = [ 'taxonomy' => $term->taxonomy, 'field' => 'term_id', 'terms' => $term->term_id, ]; $query->set( 'tax_query', $tax_query ); } } add_action( 'bpfwe/query/my_custom_filter', 'bpfwe_by_post_status' ); function bpfwe_by_post_status_new( $query ) { $term = get_queried_object(); if ( $term && isset( $term->taxonomy ) ) { $tax_query[] = $query->get('tax_query'); $tax_query[] = [ 'taxonomy' => $term->taxonomy, 'field' => 'term_id', 'terms' => $term->term_id, ]; $query->set( 'tax_query', $tax_query ); } } add_action( 'bpfwe/query/my_custom_filter_new', 'bpfwe_by_post_status_new', 10, 1 );So my question is:
- Is there a recommended way to exclude the first post while keeping pagination working correctly in the Posts Widget?
- Or is there a known issue with the Offset option affecting pagination?
Looking forward to your guidance.
Thank you.
You must be logged in to reply to this topic.