Don’t need to start with a new Query in archive.php loop
Only need to create a different loop file for the custom taxonomy and default loop post
See here for more details Filtering a custom post type by custom taxonomy in archive template
example I have taxonomy “service”
archive.php file
<?php
get_header();
if (is_post_type_archive('service') || is_tax('services-category') || is_tax('services-tags')){
get_template_part('my-loop-service'); // Get Loop for Taxonomy service
} else {
get_template_part('my-loop-post'); // Default Loop for Post
}
// Navigation
echo '<div id="my-navigation">';
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( 'Prev', 'text-domain' ),
'next_text' => __( 'Next', 'text-domain' ),
));
echo '</div>';
get_footer();
?>
Related Posts:
- Custom pagination for custom post types (by names)
- next_post_link() not working for single custom post type post
- Pagination with custom post type not working
- Changing the URL Structure of a Paginated Custom Post
- Number of pages – multiple (custom) post types
- WordPress search: pretty URLs (permalinks), custom post types and pagination
- Multiple Paginations on one Page
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Custom Post Type Rewrite Rule for Author & Paging?
- Posts in Multiple Columns and Rows with one single loop
- Newer/Older posts links display same posts on every page
- Custom post type archive with pagination?
- Pagination in plugin with custom post type
- Fix custom query pagination without changing site-wide posts-per-page settings
- Display “Post 2 of 4” on single post page?
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- Custom post type archive page pagination
- Pagination problem
- Custom post type archive not regarding ‘posts_per_page’ => -1
- Setting posts per page in query_posts
- Archive template for custom post type only lists first 10
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- How can i change the output of posts_nav_link();
- How to alter WP-JSON main query or best practise for custom endpoints
- Page vs Custom Post Types Differences/Issues
- How to display all posts from standard posts to custom post types in a loop with pagination?
- Previous/Next Link by Meta Value in CPT
- Pagination for Custom Taxonomy Page [duplicate]
- Paging doesn’t work?
- Custom template Page 2 not working
- How do you paginate a query grouped by month?
- custom post type pagination error 404
- Next Post links not working in custom post type shortcode
- Querying Custom Post Type, ordering by Custom Taxonomy Pagination Not Working
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- pagination not working for category.php (custom post types in categories)
- Cant get paginations on single.php to work with my custom post types
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom WP_Query always respond with 200 status even when no entry
- Can’t use pagination with custom taxonomy
- Trouble with pagination
- Pagination 404 on Index with custom query
- previous_post_link in same taxonomy in custom post type
- How to do admin CRUD & Pagination
- Custom ordering of CPT items not matching with the ordering of its pagination
- Break up posts per page in two sections
- How to list custom post types on a custom post type page?
- Custom post pagination trouble
- Pagination on a page
- Single parent post lists child posts with pagination
- Using custom post type as front home page pagination not working
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Problem with custom loop navigation inside the blog page
- pagination for custom post type archive page
- custom taxonomy pagination 404 error
- Custom archive page for custom taxonomy and pagination issue
- Custom post type paging return home page
- Pagination Not Working When Used With WP_Query() `offset` Property
- Pagination on custom post type without plugin
- pagination problem listing custom post types of taxonomy in wordpress
- Permalink for custom post type pages not working
- How to display custom post type pagination buttons when processing AJAX request
- Make pagination work as a carousel (custom query)
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Custom Post Type Pagination – not displaying posts
- Pagination with a custom post type
- I want to create pagination for my custom post type archive that i am displaying with loop
- Pagination URL in Custom Content Type
- Pagination functions won’t work
- pagination for a custom query
- yet another: custom post type with pagination not working in WordPress
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Custom post type with Filter and Page Nav
- Pagination fault in custom post type archive page [duplicate]
- Pagination custom post types outside loop
- Paginating custom query on category template
- Custom post type blog pagination conflict
- Custom post type pagination, single page issue
- Pagination for a Custom Taxonomy
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- WordPress Load more posts by ajax not working
- Pagination not working with custom loop
- Pagination not working with custom loop
- Archive Page Pagination not working
- Classic Custom Post Types and WP-PageNavi
- List of filtered Events is breaking paging?
- Pagination not working on homepage
- How do I paginate a custom post type listing on a custom template page?
- WordPress custom post type post and category links 404
- Pagination not working for archive
- WordPress getting problem with pagination [duplicate]
- Pagination not working
- What Is My Fault With This WP_QUERY ? [ Pagination Problem ]
- Pagination not working only on Archive-Name.php using new WP_Query
- CPT Archive Pagination – Page not found
- Pagination not working on custom post type archive
- the_post_navigation in single page with multiple taxonomies
- Archive pagination – second page shows exactly the same posts
- Two pagination in one page without AJAX