Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pagination number found_posts #80

Closed
iandunn opened this issue Nov 17, 2021 · 2 comments
Closed

Fix pagination number found_posts #80

iandunn opened this issue Nov 17, 2021 · 2 comments

Comments

@iandunn
Copy link
Member

iandunn commented Nov 17, 2021

After 483f34d, the wp:query-pagination-numbers block shows 10 pages when it should show 11.

I think the problem is the one described at https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination#Offset_Using_pre_get_posts, where found_posts needs to be adjusted to account for the new offset.

add_filter( 'found_posts', __NAMESPACE__ . '\foo', 1, 2 );
function foo( $found_posts, $query ) {
	$is_posts_index = is_posts_index( $query );
	
	if ( ! $is_posts_index ) {
		return $found_posts;
	}
	
	return $found_posts + 5;
}

This is blocked by #70 , though.

@coreymckrill
Copy link
Contributor

#70 is closed now. Is this still blocked @iandunn?

@iandunn
Copy link
Member Author

iandunn commented Feb 24, 2022

No, but it looks like the problem was also fixed by some earlier change 👍🏻

@iandunn iandunn closed this as completed Feb 24, 2022
@iandunn iandunn removed the [Status] Blocked (internal) Blocked by something we can change label Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants