Try adding 'paged' => get_query_var( 'page' )
to your query.
EDIT : For pagination to work properly the posts per page should be greater than ‘Blog pages show at most’ under Settings-> Reading section of the WordPress Admin. So there are two ways you can make this work out.
- You can set ‘Blog pages show at most’ to 1. This would show 1 post in all the blog pages unless you specify post_per_pages specifically for each query.
- The other option you have would be to use the
pre_get_posts
filter.
Example of pre_get_post filter to limit the no. of posts on a location taxonomy archive page to 2 posts per page.
function location_posts( $query ) {
if( is_tax( 'location' ) ) {
$query->set('posts_per_page', '2');
}
return $query;
}
add_filter('pre_get_posts', 'location_posts');
Related Posts:
- pagination not working on custom-taxonomy template
- Custom Taxonomy Endpoint Pagination using paginate_links()
- Can’t get a custom template taxonomy page to display
- Custom Taxonomy Archive Page
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- get_query_var(‘paged’) always returns empty
- Taxonomy Templates… by hierarchical level?
- How to display a listing template of a certain taxonomy?
- How to use wp_terms_checklist() on front end
- Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin
- Custom Taxonomy Template not respecting ‘include_children’ => ‘false’
- How can I set up a category “overview” page?
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Which template name to use for taxonomies but not their terms?
- On Taxonomy Template page, want to add Post_Type
- Custom Taxonomy terms with latest post ordered by date pagination issue
- Listing child terms of parent term
- Make Custom Taxonomy Category Use Parent Template
- Custom taxonomy template not working
- Taxonomy page lead to 404 page on pagination
- Using a different template per Custom Taxonomies for single term archive pages
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- Woocommerce custom taxonomies page
- Generic taxonomy-term template page
- 404 for a custom taxonomy?
- Why is my taxonomy template not shown?
- Meta description – template code to get category description
- Create and set templates for custom taxonomies
- How to have two different versions of a tag/category/taxonomy archive page?
- How do I create a custom archive page depending on the custom taxonomy type?
- How to create pagination for custom taxonomy in WordPress
- Taxonomy Pagination Rewrite
- Different single page templates for taxonomies
- problem in taxonomy-{taxonomy}.php pagination
- Sorting Custom Posts on Archive page with pagination
- Override Taxonomy Template
- Taxonomy Parent Name
- Custom taxonomy pagination
- Avoid taxonomy-%term%.php if more than one taxonomy
- Returning One custom taxonomy term name
- Make child taxonomy categories use a set template
- How can I make front page to display custom taxonomy page?
- Why get_page_template() doesn’t show taxonomy template file name?
- Problem with wordpress pagination
- How can I change the output display of my pagination?
- How can I get a paginated list of custom taxonomy tags with posts?
- How to add custom content to custom taxonomy
- how to access the $query variable inside taxonomy-xxx.php template file?
- Template file renders on local install, not on web
- Catch all taxonomy template
- Taxonomy archive uses incorrect template when query strings are used
- How to use custom slug and custom templates for custom taxonomy?
- Keeping session instance of random display results over pagination breaks
- add pagination in wordpress page template
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Pagination for Custom Taxonomy
- How to get a terms and posts associated with another term?
- pagination for list category posts ( Custom post type )
- Custom taxonomy archive template not recognised
- Post not showing in my custom advanced search
- Error 404 in Custom taxonomy with pagination
- How to display custom taxonomy
- Pagination with custom query (not using posts)
- WordPress doesn’t respect the template hierarchy?
- How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?
- Can you orderby slug in a taxonomy archive page using WP_Query?
- Custom Taxonomy Template Variables Available?
- query posts returns 10 records
- add_rewrite_rule pagination 404 error on page 4 and above
- Pagination links not working for custom taxonomy
- is_tax not working for custom taxonomy
- Equivalent setup_postdata for Taxonomy Term?
- How Can I Remove Child Slug From Grandchild Slug When Using Duplicate Grandchild Slugs?
- Set two terms for a post when they differ only by an accent
- Unknown column ‘wp_posts.ID’ in ‘field list
- filter for thumbnail not working for custom taxonomy term
- Custom taxonomies registered via plugin stop existing after function finishes running
- Display just the Post’s parent Category, not child
- How to Create Multi selection search Form using Default WordPress Category Terms, and Custom post Types Taxonomies Terms?
- Change the full permalink (URL) of a single post by connecting it to a specific page
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Display custom taxanomy on woocommere product page
- Showing custom taxonomy in woocommerce signle product page
- Where to find relation of custom post type category with it thubmnail image in wordpress database
- How can I show links for custom posts group by taxonomy current term and sub-term?
- Show custom taxaomy as a product meta
- Wp_insert_term doesn’t work from separate file with custom taxonomy
- Main query disturb pre_get_post by category query
- Taxonomy page loading wrong data
- Get Terms of custom Taxonomy of products with certain Product Category
- Adding term to a custom taxonomy based on term from product category
- Tracking the name of a custom taxonomy
- Reorder a page of posts of a certain taxonomy/value by a custom field
- Taxonomy URL rewrite whilst keeping filtered posts?
- How to filter and/or sort user taxonomy query inside custom user taxonomy archive page?
- Filter language in Polylang for custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- Echo ACF taxonomy field within a foreach for another taxonomy
- Custom post type paging return home page