diff --git a/content/themes/custom/models/search.php b/content/themes/custom/models/search.php index 7f86851..19b43ca 100644 --- a/content/themes/custom/models/search.php +++ b/content/themes/custom/models/search.php @@ -269,8 +269,8 @@ protected function do_pagination( array $posts, stdClass $params ) { $pagination_start = microtime( true ); // Do different pagination handling if we are doing a loadmore call - if ( DOING_AJAX ) { - $offset = $params->page > 1 ? $params->page * $params->per_page : 0; + if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { + $offset = $params->page > 1 ? ( $params->page - 1 ) * $params->per_page : 0; $posts = array_slice( $posts, $offset, $params->per_page ); } else { diff --git a/content/themes/custom/partials/search.dust b/content/themes/custom/partials/search.dust index b0e4d25..1644c14 100644 --- a/content/themes/custom/partials/search.dust +++ b/content/themes/custom/partials/search.dust @@ -40,7 +40,7 @@