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
- Filtering a custom post type by custom taxonomy in archive template
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- get term archive url / link
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Archive page with multiple taxonomies rewrite
- 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
- Removing CPT slug from URL results in 404 error for archive page
- paginate function in archive for custom-post-type
- custom post type paging not working past page 3
- Pagination gives 404 error
- Disable single pages and archives and keep preview
- Custom Taxonomy 404
- How to create archive page for taxonomy terms within custom post type
- Category and post tag archives do not include posts from custom post type
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Post Type Pagination & duplicate posts
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom post type archive page pagination
- 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
- How can i change the output of posts_nav_link();
- Custom Post Type Archive Page Filtering
- 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]
- Create template for taxonomy results limited by Custom Post Type
- Help with Elementor Pagination CPT archive 404 problem
- Custom taxonomy rewrite give pagination 404
- Querying Custom Post Type, ordering by Custom Taxonomy Pagination Not Working
- Top Level pages in wordpress giving 404, but child pages working fine
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- How to solve this custom post type goes to 404 page?
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- What’s the name of the custom post type yearly archive template?
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom Post type & Taxonomy 404
- Custom WP_Query always respond with 200 status even when no entry
- Can’t use pagination with custom taxonomy
- Taxonomy archive 404ing (not term archive)
- Custom taxonomy page returns 404
- previous_post_link in same taxonomy in custom post type
- Custom taxonomy or custom page templates?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- How to list custom post types on a custom post type page?
- Custom post type categories gives 404 error
- Custom Post Type Archive Pagination
- Taxonomy rewrite pagination 404
- Archive page for custom post type and custom taxonomy
- Advanced archive url structure (category, tag and date)
- How can I tell if I’m on a custom post type archive page?
- 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 paging return home page
- Custom Post Type Archive Page showing as 404
- Remove custom taxonamy slug with pagination
- Custom taxonomy returns 404 even with saving permalinks
- pagination problem listing custom post types of taxonomy in wordpress
- How to show custom post count in archive page
- 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?
- Order archive custom posts by taxonomy term [duplicate]
- Pagination for custom query returns 404
- Custom post type pagination problem – page 1 and 2 show same content
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Pagination with a custom post type
- I want to create pagination for my custom post type archive that i am displaying with loop
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- What am I doing wrong with my taxonomy?
- Custom Post Type tag taxonomy “Page Not Found”
- Custom taxonomy in custom post type archive with pagination
- Pagination fault in custom post type archive page [duplicate]
- archive-{custom_post_type}.php not getting recognized wordpress
- Archive.php is not displaying tags
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Pagination in custom loop for custom post type throwing 404 error
- Pagination for a Custom Taxonomy
- paging is not working properly on news archives page [duplicate]
- Pagination URL order
- 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
- See the process of creating a taxonomy and tell me where I made a mistake
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Pagination on category pages using wp_pagenavi causes 404 errors
- the_post_navigation in single page with multiple taxonomies
- Show custom category archive as front page and remove taxonomy slug from urls