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 type pagination 404 fix?
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post type 404s with rewriting even after resetting permalinks
- Custom Post Types 404 Issue
- Custom post type archive 404’s with paginate_links
- Pagination throws 404 error on custom taxonomy archive pages
- 404 on child page when parent page slug is identical to custom post type
- 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?
- Child pages on hierarchical Custom Post Types 404s
- Custom Post Type Works but Still Shows “Page Not Found”
- WordPress custom post type category pagination 404 Error
- Pagination throws 404
- How do I redirect all 404 errors of a specific post type to another URL?
- Removing CPT slug from URL results in 404 error for archive page
- WordPress monthly archive links result in 404
- Remove Slug from Custom Post Type results in 404
- How to remove CPT comment feed from head?
- Custom Taxonomy archive returns 404
- Pagination gives 404 error
- 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 rewrite rules not working, how to alter the rewrite order?
- 404 error on custom post type
- Multisite custom post type’s single page 404
- 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
- page not found for single-type.php file
- Custom taxonomy page returns 404
- Some users getting a 404 when previewing draft posts/pages
- One Custom post type 404’s others don’t
- Custom taxonomy template list not working (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
- Custom taxonomy template shows 404 Error
- 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
- Safe to throw 404 error in request filter?
- 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
- Updating a custom post status after an expiry date rather than trashing it
- Can’t Export Custom Post Types With Export Tool In A Custom Theme
- Preview url not working outside wp-admin
- Custom post type single page 404
- 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
- Enabling hierarchical in a Custom Post Type gives error 404
- Standard Page Child of CPT Not Found (404)
- Custom Post Type Front Page Gives 404
- 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
- Redirect preview single post link to a page
- Pages displays correctly but returning a 404 error in http header.
- 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
- 404 with Custom Post Type
- How do I paginate a custom post type listing on a custom template page?
- WordPress custom post type post and category links 404