Paginate_links won’t create the right links on a taxonomy filtered custom post type archive

If, for example, I click on the “2”, the page loaded as removed my taxonomy filter(s) and paginate navigation “max-page” looks like (seems to be) the number of pages non filtered by taxonomy It’s not that the (taxonomy) filters are removed from the pagination links, but instead, the filters are actually never added because the … Read more

Edit format of Paginate_Links()

There is no clean way to do this (that I notice from quick look at rather messy code of it), but $n_display is passed though formatting number_format_i18n() function which does have a filter. So you could try something like: function make_number_into_dot( $number ) { return ‘o’; } add_filter( ‘number_format_i18n’, ‘make_number_into_dot’ ); // your pagination handling … Read more

Search – Ajax – Alter Query Parameters with Pagination

I think this is what you want. base is set via home_url(), format is page/%#%/, search query arg is added via add_args if it exists: $args = array( ‘base’ => home_url( ‘/%_%’ ), ‘format’ => ‘page/%#%/’, ‘current’ => max( 1, get_query_var(‘paged’) ), ‘total’ => $temp->max_num_pages, ); if( isset($_GET[‘s’]) ){ $args[‘add_args’] = array( ‘s’ => $_GET[‘s’] … Read more

How to change URL structure for pagination pages?

You may use the format argument of wp_link_pages function like this: <?php $args = array( ‘base’ => ‘%_%’, ‘format’ => ‘?page=%#%’, ‘total’ => 1, ‘current’ => 0, ‘show_all’ => False, ‘end_size’ => 1, ‘mid_size’ => 2, ‘prev_next’ => True, ‘prev_text’ => __(‘« Previous’), ‘next_text’ => __(‘Next »’), ‘type’ => ‘plain’, ‘add_args’ => False, ‘add_fragment’ => … Read more

Combining WordPress pagination functions for archives and search results

From the Codex: To add pagination to your search results and archives, you can use the following example: <?php global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) ) ), ‘format’ => ‘?paged=%#%’, ‘current’ => max( 1, get_query_var(‘paged’) ), ‘total’ => $wp_query->max_num_pages … Read more

Pagination Not Displaying on Custom Term Archive

There where one or two problems with the code that I sorted out Big changes $number_of_terms = count( get_terms( ‘100list’ ) ); is replaced by $number_of_terms = wp_count_terms( ‘100list’ );. The reason is that wp_count_terms is already there to return the term count natively get_categories is replaced by get_terms as get_terms accepts the offset parameter … Read more

Custom Search Page Pagination Not Working

You’re running into a conflict between your replacement query and the default search query that’s running behind the scenes. Instead of running a new WP_Query, try modifying the default query by hooking to pre_get_posts: function wpse276396_search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $text = urldecode( get_query_var(‘search_text’) ); $my_products = aws_search_byozan($text); … Read more