Skip to content

Commit bc198cf

Browse files
Fix: Taxonomy pagination improvements (#2272)
* Fix: Update Order Author to Match Listing Author * Fixed DivisionByZeroError * removed extra code * undo class-order.php code --------- Co-authored-by: Mehedi Hasan ⚡️ <[email protected]>
1 parent 50b88b3 commit bc198cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/model/ListingTaxonomy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function set_terms( ?int $current_page = null ) {
128128
$total_terms = wp_count_terms( $this->tax, array_merge( $args, ['number' => 0, 'offset' => 0] ) );
129129

130130
$this->terms = array_slice( $all_terms, $offset, $this->per_page) ;
131-
$this->total_pages = ceil( $total_terms / $this->per_page );
131+
$this->total_pages = ( $this->per_page > 0 ) ? ceil( $total_terms / $this->per_page ) : 1;
132132
$this->current_page = $current_page; // Store current page for reference
133133

134134
}

0 commit comments

Comments
 (0)