From a3f40a048c1b08a38778cc278f7231c877716822 Mon Sep 17 00:00:00 2001 From: David Beentjes <75703724+unlocdavid@users.noreply.github.com> Date: Wed, 8 Oct 2025 10:00:31 +0200 Subject: [PATCH] Use locally defined query for current page When using custom query the 'paged' query var of the global query was still used to set the currentPage. Now it respects the locally defined query. --- src/Pagi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pagi.php b/src/Pagi.php index 2ce65ba..1226a8f 100644 --- a/src/Pagi.php +++ b/src/Pagi.php @@ -54,7 +54,7 @@ protected function prepare() } $this->perPage = $this->query->get('posts_per_page', 1); - $this->currentPage = max(1, absint(get_query_var('paged'))); + $this->currentPage = max(1, absint($this->query->get('paged'))); } /**