I had a colleague take a look at the entire plugin code and he found a function I had written which was forcing the query to only show ‘Published’ posts. This was interfering with the preview as it was being treated as a front-end query. I was able to bypass it by adding the parameter !$query->is_preview()
to my conditions and it is now sorted.
Related Posts:
- CPT unsaved draft gives error 404 – when Post Formats support enabled
- Custom post type single page returns 404 error
- Getting hierarchical custom post type permalinks to work just like pages
- Custom Post Types 404 Issue
- Custom post type archive 404’s with paginate_links
- Pagination throws 404 error on custom taxonomy archive pages
- Single custom post type page redirecting to 404 page
- Hierachical Custom post types permalinks not working
- How to disable a Custom Post Type Feed?
- How can i avoid the permalink start with ‘blog’ while using the custom post type?
- Custom Post Type Works but Still Shows “Page Not Found”
- WordPress custom post type category pagination 404 Error
- Removing CPT slug from URL results in 404 error for archive page
- WordPress monthly archive links result in 404
- How to remove CPT comment feed from head?
- Custom Taxonomy archive returns 404
- Disable single pages and archives and keep preview
- Auto Draft Specific Categories Posts after a certain number of Days
- Custom Taxonomy 404
- Pagination with custom post types results in 404 issues
- Create second custom 404 page for selected post type
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- custom post type and custom taxonomy url conflict
- Why my custom post posts aren’t showing (404 error / page not found)
- An empty Custom Post Type Archive page returns 404 in WP 3.1
- How To Create A Custom Taxonomy 404 Page
- Custom Search for Drafts in Custom Post Type
- Custom Post Type + 20k posts = blank/404 within Admin edit.php [duplicate]
- Bizarre Permalinks Issue: 404 Errors Everywhere
- Custom taxonomy in URL showing 404
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- Custom post type “preview” not working
- Wrong request query on cpt and tax
- Help with Elementor Pagination CPT archive 404 problem
- Trouble with CPT Child 404
- Using taxonomy term in CPT permalink – Pages 404’s
- Custom post URL 404 error
- Single post with a Custom Post Type returns 404, when archives of the CPT work correctly
- Set a CPT slug as a base name for all the taxonomies
- WordPress randomly shows 404 errors
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Custom post type archive pagination 404
- Custom post type permalink tag 404
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Hierarchical permalinks for custom post type and taxonomy
- Top Level pages in wordpress giving 404, but child pages working fine
- cutsom posts 404ing
- 404 in custom post type feed with mistake permalink
- Custom post type pagination 404
- How to solve this custom post type goes to 404 page?
- Custom post type single page (single-{CPT-name}) 404 when slug includes hyphens
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- 404 Error on form submission within custom post type
- Custom WP_Query always respond with 200 status even when no entry
- page not found for single-type.php file
- Custom taxonomy page returns 404
- Custom post type permalink returns 404 when set to private
- Custom post type slug 404
- How to filter a custom post type by custom taxonomy without 404
- Custom Post 404
- Post type Permalink
- Custom post type categories gives 404 error
- Direct form to a custom page template
- Custom post type draft use wrong template
- Permalink Trouble with custom post types
- Permalinks not working (404) for the ‘item’ post type
- either single-{custom}.php 404’s OR /taxonomy/ 404’s – custom post type and taxonomy permalinks
- Custom Post Type Child Won’t Come Through With Pretty Permalinks
- Problem with custom loop navigation inside the blog page
- Can’t Export Custom Post Types With Export Tool In A Custom Theme
- Preview url not working outside wp-admin
- Sudden 404 pages on product category archives
- Custom taxonomy returns 404 even with saving permalinks
- Show custom post status when logged out
- Custom post shows 404 after theme change
- How can I get custom post types to recognize pretty permalink variables?
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Published page but it is page not found
- Pagination for custom query returns 404
- New entries to custom post type produce 404 on single view
- Custom Post Type slug and WPML gets 404 error
- Add new custom post type screen (admin area) results into 404
- Some permalinks on Apache/localhost development setup return 404’s when set to anything other than plain permalinks
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- pre_get_posts gives 404 error on Custom Post
- Custom 404 redirect for a luddite
- WP gives 404 error for custom post type with GET variable
- 404 error next-page [2] PageNavi custom type taxonomy
- Custom Post Type Rewrite – Page Not Found
- What am I doing wrong with my taxonomy?
- Cannot use pages created on WP
- Pagination in custom loop for custom post type throwing 404 error
- 404 for children in hierarchical custom post type
- Submiting custom form give error 404
- Capability to read user’s own draft post of CPT
- How do I paginate a custom post type listing on a custom template page?
- WordPress custom post type post and category links 404
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Pagination on category pages using wp_pagenavi causes 404 errors
- Custom post type REST api 404: Updating failed. No route was found matching the URL and request method