This function fixed the issue:
function change_posttype() {
if( is_archive() && !is_admin() ) {
set_query_var( 'post_type', array( 'post', 'portfolio' ) );
}
}
add_action( 'parse_query', 'change_posttype' );
Then I just removed the paged and query_string function in my code and just left the regular loop 🙂
Related Posts:
- Custom post type pagination 404 fix?
- Pagination throws 404
- Custom Taxonomy archive returns 404
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Custom post type pagination 404
- 404 error next-page [2] PageNavi custom type taxonomy
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Custom post type archive 404’s with paginate_links
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Multiple Paginations on one Page
- Create permalink structure for one taxonomy archive per custom post type
- Archive page…limiting posts per page
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- WordPress custom post type category pagination 404 Error
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Custom post type archive with pagination?
- Removing CPT slug from URL results in 404 error for archive page
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to show a tag archive of one post type only
- Custom taxonomy archive page not working
- How to show multiple post types on taxonomy archive?
- Disable single pages and archives and keep preview
- Custom Taxonomy 404
- Pagination with custom post types results in 404 issues
- Paginated Taxonomy Term Archive including one post per term
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- custom post type and custom taxonomy url conflict
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom post type archive page pagination
- Display custom post type taxonomies as an archive page
- Repeating posts when paginating random posts
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Archive page for taxonomy terms
- Custom taxonomy in URL showing 404
- How can i change the output of posts_nav_link();
- Root slug of taxonomy returning 404
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- Wrong request query on cpt and tax
- Pagination for Custom Taxonomy Page [duplicate]
- Help with Elementor Pagination CPT archive 404 problem
- How do I move/order posts with a tag to the end?
- Custom taxonomy rewrite give pagination 404
- Custom post URL 404 error
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Custom Post Type Pagination Paginates Only in URL Structure
- Custom post type permalink tag 404
- Querying Custom Post Type, ordering by Custom Taxonomy Pagination Not Working
- Hierarchical permalinks for custom post type and taxonomy
- Top Level pages in wordpress giving 404, but child pages working fine
- Archive for a Taxonomy of a Custom Post type
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom Post type & Taxonomy 404
- Can’t use pagination with custom taxonomy
- Custom taxonomy page returns 404
- previous_post_link in same taxonomy in custom post type
- Dynamically insert an article at the top of a taxonomy archive – or?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to filter a custom post type by custom taxonomy without 404
- Custom post type and custom taxonomy 404 on page 2
- How to list custom post types on a custom post type page?
- Custom post type categories gives 404 error
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Archive page for custom post type and custom taxonomy
- Safe to throw 404 error in request filter?
- Advanced archive url structure (category, tag and date)
- either single-{custom}.php 404’s OR /taxonomy/ 404’s – custom post type and taxonomy permalinks
- 2 custom post type paging in 1 custom taxonomy
- Problem with custom loop navigation inside the blog page
- custom taxonomy pagination 404 error
- Custom archive page for custom taxonomy and pagination issue
- Custom Post Type Archive Page showing as 404
- pagination problem listing custom post types of taxonomy in wordpress
- Set up Custom Taxonomy Archive Template File To Cover 3 Categories
- How to show custom post count in archive page
- WordPress custom post type taxonomy paging
- How to display custom post type pagination buttons when processing AJAX request
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Custom category taxonomy – archive page not showing up
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- CPT/Taxonomy/Postname permalink structure makes pagination break
- Pagination with a custom post type
- I want to create pagination for my custom post type archive that i am displaying with loop
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Pagination not working (page/2 retunring 404 page)
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- Custom taxonomy archive slug overwrites static page
- What am I doing wrong with my taxonomy?
- Pods pagination erases my sub menu
- Pagination fault in custom post type archive page [duplicate]
- archive-{custom_post_type}.php not getting recognized wordpress
- Paginate custom taxonomy category with wp_custom_pagination
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Pagination for a Custom Taxonomy
- how to limit query_post to first page?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- How do I paginate a custom post type listing on a custom template page?
- WordPress custom post type post and category links 404
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Show custom category archive as front page and remove taxonomy slug from urls
- Custom Taxonomy archive with url parameters