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
- 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
- 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?
- Dynamically insert an article at the top of a taxonomy archive – or?
- 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 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
- Custom Post Type Archive Pagination
- Taxonomy rewrite pagination 404
- 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
- How can I tell if I’m on a custom post type archive page?
- 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 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
- 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?
- 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
- 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?
- Custom Post Type tag taxonomy “Page Not Found”
- Pods pagination erases my sub menu
- 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
- Paginate custom taxonomy category with wp_custom_pagination
- 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 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
- Pagination not working for archive
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- 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
- Custom post type category pages pagination returns 404
- Taxonomy term archive claims there are no posts, but there are. How to resolve?
- Create an archive page by combining two post type
- WordPress Custom Post Type Archive, filter by category and get pagination working
- Custom Taxonomy archive with url parameters