admin管理员组文章数量:1430860
I have a problem with the Woocommerce Pagination but only on the Search Page. On category sites the pagination links are working just fine.
But on the Search Page the pagination generates links like this:
"/page/2/?s=adalya&post_type=product"
Even though this url does not work but it displays the root url of my domain and does not generate a 404 not found error.
I would like to change the whole search URL structure to something like:
"/search/search-query/2"
My Pagination links
<nav class="woocommerce-pagination">
<?php
$pages = paginate_links( apply_filters( 'woocommerce_pagination_args', array( // WPCS: XSS ok.
'base' => $base,
'format' => $format,
'add_args' => false,
'current' => max( 1, $current ),
'total' => $total,
'prev_text' => '<i class="icon-angle-left"></i>',
'next_text' => '<i class="icon-angle-right"></i>',
'type' => 'array',
'end_size' => 3,
'mid_size' => 3,
) ) );
if ( is_array( $pages ) ) {
$paged = ( get_query_var( 'paged' ) == 0 ) ? 1 : get_query_var( 'paged' );
echo '<ul class="page-numbers nav-pagination links text-center">';
foreach ( $pages as $page ) {
$page = str_replace( 'page-numbers', 'page-number', $page );
echo '<li>' . $page . '</li>';
}
echo '</ul>';
}
?>
</nav>
</div>
本文标签: custom post typesWoocommerce search pagination not working
版权声明:本文标题:custom post types - Woocommerce search pagination not working 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745566771a2663806.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论