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)
- Pagination throws 404 error on custom taxonomy archive pages
- Changing the URL Structure of a Paginated Custom Post
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- WordPress search: pretty URLs (permalinks), custom post types and pagination
- Pre get posts for single post
- Pagination not working with custom category template
- Custom Post Type pagination – normal solutions aren’t helping
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Posts in Multiple Columns and Rows with one single loop
- Pagination in plugin with custom post type
- Fix custom query pagination without changing site-wide posts-per-page settings
- Paginate Custom Post Type Page
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- Pagination not working
- Pagination Custom post type
- Pagination Issue: Custom Post Type In Index
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom post type archive page pagination
- Pagination problem
- Custom post type archive not regarding ‘posts_per_page’ => -1
- Unable to get paginate_links working with a custom query [duplicate]
- Setting posts per page in query_posts
- Custom post type, permalinks & pagination, going wrong
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Pagination for custom php code
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- How can i change the output of posts_nav_link();
- Pagination on a custom post type loop
- How to alter WP-JSON main query or best practise for custom endpoints
- Page vs Custom Post Types Differences/Issues
- Pagination for Custom Taxonomy Page [duplicate]
- Pagination on with query_posts in custom post type template
- Paging doesn’t work?
- Help with Elementor Pagination CPT archive 404 problem
- Custom taxonomy rewrite give pagination 404
- Next and Previous Posts of Same Parent
- Custom template Page 2 not working
- How to handle paged param in post and custom-post-type?
- custom post type pagination error 404
- Next Post links not working in custom post type shortcode
- Custom Post Types strange pagination problem
- 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)
- Custom post type pagination 404
- Pagination broken by naming conflict between CPT and Page
- Pagination Error : Duplicate argument being outputted
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- previous_post_link in same taxonomy in custom post type
- Pagination hitting 404 page on /page/4
- Using Pagination for Custom Post Type and keeps returning 404
- Pagination for search results of custom post type [duplicate]
- Pagination of custom post type leads to 404 error
- All blog posts are not showing up
- Custom post pagination trouble
- Custom Post Type, Pagination and 404s?
- 2 custom post type paging in 1 custom taxonomy
- custom taxonomy pagination 404 error
- Sticky posts limit query and pagination for a custom post type
- Pagination in custom post type archive.php not working
- Custom Post Type Pagination getting 404 error
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- User Archive page for Custom Post Type – Pagination Issue
- Custom post pagination not working
- CPT/Taxonomy/Postname permalink structure makes pagination break
- How to get a custom post type archive paged when using a custom field for post sorting?
- Pagination in wp-admin for CPT
- 404 error next-page [2] PageNavi custom type taxonomy
- Add pagination to custom page
- Pods pagination erases my sub menu
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Get Non-Paginated Index of Post in Paginated Query
- Custom post type with Filter and Page Nav
- Custom post type archive pagination with HTML5Blank theme?
- Paginate custom taxonomy category with wp_custom_pagination
- Custom post type navigation on static page
- Custom pagination [duplicate]
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- Using pagination with specific custom post type [duplicate]
- Pagination not working with custom loop
- how to limit query_post to first page?
- Pagination not working with custom loop
- Pagination not working with custom loop
- Archive Page Pagination not working
- Classic Custom Post Types and WP-PageNavi
- Pagination not working with custom loop
- send user to first page of results when reposting to page?
- Fourth page of custom post type archive page does not exist
- Pagination broke after updateto WordPress 3.4 [duplicate]
- WordPress pagination URL
- Unable to display paging navigation with a custom post type loop
- WPNavi pagination links not working on custom pages
- the_post_navigation in single page with multiple taxonomies
- Custom post type category pages pagination returns 404
- Query Multiple Post Types and Paginate Newly Created List
- remove pagination from a single blog entry