WC Custom Query Pagination Problem
-
Hi Guys,
I’m trying to pass a parameter on the URL of a page without much success. Here’s what my URL looks like now: http://benronperfume.flywheelsites.com/maincat/?cat=women-testers
http://benronperfume.flywheelsites.com/maincat/?cat=mens-testersBut when trying to page up, its all breaks up obviously because the lack of formatting.
Ultimetly I would like to have something like
http://benronperfume.flywheelsites.com/maincat/women-testers/with pagination passing like:
http://benronperfume.flywheelsites.com/maincat/women-testers/1/
http://benronperfume.flywheelsites.com/maincat/women-testers/2/But I don’t know how to mess around with the permalinks to create that.
Any help will be greatly appreciated!here’s my pagination code:
/* Pagination */ function custom_pagination($numpages = '', $pagerange = '', $paged='') { if (empty($pagerange)) { $pagerange = 2; } global $paged; if (empty($paged)) { $paged = 1; } if ($numpages == '') { global $wp_query; $numpages = $wp_query->max_num_pages; if(!$numpages) { $numpages = 1; } } $pagination_args = array( 'base' => get_pagenum_link(1) . '%_%', 'format' => '/page/%#%/', 'total' => $numpages, 'current' => $paged, 'show_all' => False, 'end_size' => 1, 'mid_size' => $pagerange, 'prev_next' => True, 'prev_text' => __('«'), 'next_text' => __('»'), 'type' => 'plain', 'add_args' => false, 'add_fragment' => '' ); $paginate_links = paginate_links($pagination_args); if ($paginate_links) { echo "<nav class='tw-pagination'>"; echo "<span class='page-numbers page-num'>Page " . $paged . " of " . $numpages . "</span> "; echo $paginate_links; echo "</nav>"; } }
The topic ‘WC Custom Query Pagination Problem’ is closed to new replies.