The registration code was called inside the is_admin()
. Moving the code outside solved the issue.
/*if(is_admin())
{*/
$this->sconfig= ['post_type'=> 'event', 'slug'=>'events'];
add_action('init', array($this, 'register_event_posttype'));
/*}*/
Related Posts:
- Custom post type pagination 404 fix?
- Get the Category Name instead of ID from WP-API
- React post to WordPress custom post type
- Custom Post Type not showing in Rest API on Multisite
- WordPress API for custom post types returns rest_no_route
- How to see posts in taxonomy endpoint
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- How to make an API call to a custom post type but filtering by meta value?
- How can I create new CustomPostType record using wp.api.collections?
- How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post type 404s with rewriting even after resetting permalinks
- Per Post Type Revision Numbers
- Get list of all registered post types slugs
- 404 on child page when parent page slug is identical to custom post type
- Fetching private posts or custom post types via WP-API with basic authentication
- custom post types don’t appear in RSS
- Child pages on hierarchical Custom Post Types 404s
- WP Rest API Querying Custom Posts by ACF fields
- Pagination throws 404
- How to get dynamically custom post type that are under a certain category
- How do I redirect all 404 errors of a specific post type to another URL?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Remove Slug from Custom Post Type results in 404
- How to remove CPT comment feed from head?
- Get custom post type REST API not working
- Registered Post Type Isn’t Showing in Admin Menu
- Pagination gives 404 error
- Custom search with Custom Fields in WP REST API?
- 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 API REST is not working
- Add custom post type to Backbone collections
- How To Create A Custom Taxonomy 404 Page
- Add custom parameter to REST API request of a custom post type?
- Custom Taxonomy Invalid in REST API
- How do I display content to users who are not logged in instead of 404 on Private custom posts?
- Cannot add custom field to “orderby” parameter in Rest API
- Help with Elementor Pagination CPT archive 404 problem
- Getting meta in editor plugin, and event triggering issue
- Trouble with CPT Child 404
- Incorrect post_type in url of taxonomy term
- WP Rest API – How to get an empty response if query has no posts
- Using taxonomy term in CPT permalink – Pages 404’s
- How to prevent a CPT’s slug and page slug from conflicting with each other?
- API Rest Custom Post Type doesn’t return all data
- Custom REST endpoints for a custom post type with custom fields
- WP-API select custom taxonomy when creating a post
- Custom post type archive pagination 404
- How to define which register_post_status goes to which register_post_type?
- cutsom posts 404ing
- 404 in custom post type feed with mistake permalink
- Is it possible to filter the display name for post formats for display in the Formats meta box?
- Page not found for custom post type UI plugin and taxonomy
- How to solve this custom post type goes to 404 page?
- How to Set Taxonomy Object Description?
- Show only public custom posts in home page
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- post_parent in custom post type
- Custom filter for main search: how to exclude specific post_type from search results
- One Custom post type 404’s others don’t
- WP API Response does not show my registered metadata
- Custom taxonomy template list not working (404)
- How to handle new post from API request?
- Why is wp api returning old acf values?
- Custom Post 404
- Custom taxonomy template shows 404 Error
- wp-json API: not logged in when clicking link to the API from admin mode
- Custom post type in theme not appearing
- Custom Post Type Child Won’t Come Through With Pretty Permalinks
- How to hide list from custom post type
- Custom endpoint filtering post by custom taxonomies
- Why is my custom post content only viewable when signed into WordPress?
- wp rest api orderby field in a custom table
- URL issue retrieving Custom Post Types using Backbone JS API
- Custom post type single page 404
- How to add field to custom post type endpoint
- How can I get custom post types to recognize pretty permalink variables?
- Issue with CPT posts within WP REST API showing as []
- Enabling hierarchical in a Custom Post Type gives error 404
- Standard Page Child of CPT Not Found (404)
- Saving custom post types post_meta over REST-API fails
- Published page but it is page not found
- New entries to custom post type produce 404 on single view
- Post types showing tables…Can I do that?
- Custom Post Type Rewrite – Page Not Found
- do action inside a class is not working
- Updated from 3.8 to 4.2 and all post types changed to “post”
- Pages displays correctly but returning a 404 error in http header.
- How would I get a list of posts from a custom post type
- 404 with Custom Post Type
- How to add post type in masonry posts elementory widget
- Pagination on category pages using wp_pagenavi causes 404 errors
- Store custom post type with JSON content
- How to debug a 404 error on pages whose content is perfectly displayed when I explore it?
- Get all posts of any post type in a category from REST API
- Single custom post type page redirect to 404 page
- Custom post type single page fine for admin, 404 from front