Pagination is always showing the page 1 listings regardless of page

I created a template with “Listing Search Form” “Listings” and “Pagination”

The pagination shows up and in my case shows 3 pages. But page 1, 2, and 3 show the same listings. What could I be doing wrong? You can see this in action here: Auctions – Furrow Auction Company

Thank you.

Update:
I should note that I’ve added the following code to plugins/hivepress/includes/blocks/class-listings.php in “public function render() {” just above:

// Render regular listings.
while ( $regular_query->have_posts() ) {|

Also this: $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;

Additional code:

				if( isset($_GET["t"]) && $_GET["t"] == 'current' ){
					$query = Models\Listing::query();
					$query->set_args(
						[
							'meta_query' => [
								'relation' => 'OR', 
								[
									'key' => 'hp_auction_start_date',
									'value' => date('Y-m-d'),
									'compare' => '>=', // Compare for dates earlier than or equal to September 6, 2023
									'type' => 'DATE',
								],
								[
									'key' => 'hp_auction_end_date',
									'value' => date('Y-m-d'),
									'compare' => '>=', // Compare for dates earlier than or equal to September 6, 2023
									'type' => 'DATE',
								],
							],
							'meta_key' => 'hp_auction_start_date',
							'orderby' => 'meta_value',
							'order' => 'ASC',
							'paged' => $paged
						]
					);
					$regular_query = new \WP_Query( $query->get_args() ); 
				}elseif(isset($_GET["t"]) && $_GET["t"] == 'past' ){  
					$query = Models\Listing::query();
					$soldclass = 'listingsold';
					$query->set_args(
						[
							'meta_query' => [
								'relation' => 'OR', 
								[
									'relation' => 'AND',
									[
										'key' => 'hp_auction_start_date',
										'value' => date('Y-m-d'),
										'compare' => '<', 
										'type' => 'DATE',
									],								
									[
										'key' => 'hp_auction_end_date',
										'compare' => 'NOT EXISTS', 
									],
								],								
								[
									//'relation' => 'AND',
									[
										'key' => 'hp_auction_end_date',
										'value' => date('Y-m-d'),
										'compare' => '<', 
										'type' => 'DATE',
									],								
								],
							],
							'meta_key' => 'hp_auction_start_date',
							'orderby' => 'meta_value',
							'order' => 'DESC',
							'paged' => $paged
						]
					);
					$regular_query = new \WP_Query( $query->get_args() ); 
				}

Hi,

If you are trying to create a listings page with a custom query, unfortunately, there is no PHP snippet; it will require a custom implementation. But, if you mean that there is a default bug with pagination, please provide more details and we will check it out on our end. Also, check if this error is repeated on the demo version.

1 Like

Thanks. I think I figured out what I’m doing wrong.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.