Found the answer:
After a looong day debugging thru wordpress core, I managed to solve
this issue.Basicly, you CANT have a PAGE and a CUSTOM POST TYPE with the same
name. If you do, the permalink rewrite rules will get confused and
trigger a 404.A very simple solution I’m using is: The page that lists the custom
post types is called in plural (eg. products) and the actual post type
name is in singular (eg. product). So they dont conflict and it’s all
fine.Done Done! Hope this will save people’s time.
Related Posts:
- Passing and retrieving query vars in wordpress
- Get the current page URL (including pagination)
- Get current URL (permalink) without /page/{pagenum}/
- Why does `get_permalink()` produces an add. DB request without $post->filter?
- Date based URLs for custom posts and pagination
- Adding anchor to paginate_links + Safari anchor bug
- Custom permalink with pagination
- 404 on category.php pagination
- Add ‘articles’ prefix before blog posts url without affecting pagination
- Clean install – Changing permalinks in twentyeleven give 404
- Custom permalink for search and pagination
- wp_logout_url redirects to incorrect page because of pagination
- How to Get Page 2 / Paginated RSS Feed with Custom Permalink Structure?
- Pagination Issue – /page/2 404
- next_posts_link URL does not include name of custom post type
- Why is page/2/ not working?
- Pagination for blog posts reloading same page [closed]
- How to handle paging/pagination with a custom permalink?
- Change permalink structure for pagination only
- Pagination using paginate_links
- Home page Pagination – Other pages do not redirect to home page template
- Pagination url for page template
- problem with pagination in custom permalinks
- Whole site’s pagination not working after rewriting product permalink
- WordPress /page/2 gives 404 when custom permalinks is set to %category%%postname%
- How to get a clean pagination link without variable
- Added .html to Woocommerce permalink but pagination don’t work!
- Pagination links for taxonomy archive page 404 error on every page except first
- WordPress Pagination Not Working After Transfer from Localhost
- Add Custom Pagination Permalink
- Search page Paginations not working
- Pagination is not working, how to trace it properly?
- How to change pagination base from slash to query form?
- Category pagination first link works, remaining don’t
- Why doesn’t my page know it’s a page (won’t return true for is_page())?
- Getting the terms from “Beautiful Taxonomy Filters” Results ot Integrate into “Ajax Load More”
- Post archive pages bringing me to a 404 page
- How can I reverse engineer a Permalink to Find the Page?
- Mapping Domains to Permalinks (not multisite)
- How to remove dates from existing permalinks?
- Setting up WordPress with Custom Permalinks and no .htaccess File?
- How would I create a different permalink structure for pages and posts?
- My permalinks are broken! Can I use mod_rewrite to ignore a physical file?
- Is there an action for when permalinks are rebuilt?
- When creating a WordPress page, a “-2” suffix is added to new pages’ permalinks
- mod_rewrite enabled but Permalinks show index.php
- Why does /wp-json/ not work on the “plain” permalink structure?
- How to change “permalink” structure in “WordPress Thesis” theme?
- Turn off %postname% auto-incrementing?
- ‘paged’ in wp_query doesn’t work
- Display different number of posts from one category on the different pages
- Custom Taxonomy URL
- rewrite_rule for custom post type doesn’t affect get_permalink
- Custom attachment permalink structure [closed]
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Get page by path – honoring permalink settings (urls w/slashes)
- How to stop WordPress from removing & from URL?
- Nginx Rewrite Rule:: index.html added to every permalink
- Help with Elementor Pagination CPT archive 404 problem
- Share same Slug for a Custom Post Type and 2 Taxonomies
- Custom Post Type Yearly Archive Permalinks
- Pagination Broken on Static Pages but Works on Blog Articles
- Avoid repeated post on page 2 when excluding one on page 1
- Post preview gives 404 when permalinks are purely date based
- How to link the title adding a permalink?
- rename ‘page’ URL fragment in pretty permalinks
- Can’t get permalinks working!
- Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)
- Page navigation doesn’t seem to work when I add offset?
- WordPress not generating .htaccess but tells me that (Permalink structure updated.)
- Permalink with anchor on home page to single page
- How do I keep multiple domain for my wordpress site
- how to set up wp in folder within static website?
- Permalink Structure not updating .htaccess
- Multiple sites with pretty permalinks with nginx
- How do I rewrite attachment urls when permalink structure contains %category%?
- WP_Query Pagination
- How to change URL from /%postname%/ to custom-name/%category%/%year%/%monthnum%/%day%/%postname%/
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- 404 page on custom search pagination
- Permalink structure /page/page/cpt-post gives 404 with pagination
- Changing permalink structure for Posts
- Paging works correctly on local version, but not live?
- Paginate nested query of child posts
- Author permalink
- Multiple Permalink Patterns for one page
- WordPress permalinks first word title
- I can get the permalink or the excerpt to work correctly, but not both
- WordPress permalink issue on AWS
- Pagination not working with WP_QUERY
- WP Admin Bar not showing with custom permalink structure for pages
- WP_Query with meta_value_num and meta_query not paged correctly
- Why doesn’t WP update my .htaccess file?
- wp_query pagination links producing 404
- How is a URL getting mapped to a page template
- What is the issue with our links? It creates a loop
- Pagination problem with multiple loops on the same page
- Page and post auto links
- Query Multiple Post Types and Paginate Newly Created List
- Changing the URL slug causes redirecting to homepage, or showing 404 or missing lang_code issue