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?
- Use register_post_type() to modify an existing post type
- Custom post type single page returns 404 error
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- Getting hierarchical custom post type permalinks to work just like pages
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post types filtered by taxonomy using REST API v2
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- Custom post type 404s with rewriting even after resetting permalinks
- Per Post Type Revision Numbers
- Get list of all registered post types slugs
- Custom Post Types 404 Issue
- Update CPT meta data using REST API
- 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
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- WP_Query ignores post_type in category view
- Fetching private posts or custom post types via WP-API with basic authentication
- Single custom post type page redirecting to 404 page
- WordPress REST Create Post of Custom Type
- How to get only posts, pages and custom post types in WordPress
- REST API: How can I restrict a custom post type to only be accessible by authenticated users?
- Hierachical Custom post types permalinks not working
- Show custom post type endpoint in REST API just if user has capability
- How to disable a Custom Post Type Feed?
- How can i avoid the permalink start with ‘blog’ while using the custom post type?
- How do I implement custom fields without using any plugins?
- custom post types don’t appear in RSS
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Child pages on hierarchical Custom Post Types 404s
- WP Rest API Querying Custom Posts by ACF fields
- Custom Post Type Works but Still Shows “Page Not Found”
- WordPress custom post type category pagination 404 Error
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- 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?
- Removing CPT slug from URL results in 404 error for archive page
- WordPress monthly archive links result in 404
- 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?
- Rest Api v2 orderby meta_key in custom post type
- Get custom post type REST API not working
- Registered Post Type Isn’t Showing in Admin Menu
- Custom Taxonomy archive returns 404
- Pagination gives 404 error
- Custom Taxonomy 404
- Pagination with custom post types results in 404 issues
- How to add custom fields to admin UI and REST API response?
- WordPress Rest API only returns content when posttype has editor capability
- Create second custom 404 page for selected post type
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom search with Custom Fields in WP REST API?
- Wp Rest API request posts from a custom taxonomy
- Custom Post Type rewrite rules not working, how to alter the rewrite order?
- Recommended way to remove WP REST API returned data for custom post
- 404 error on custom post type
- Multisite custom post type’s single page 404
- custom post type and custom taxonomy url conflict
- Custom Post Type and API REST is not working
- Add custom post type to Backbone collections
- Why my custom post posts aren’t showing (404 error / page not found)
- Multiple post type queries (with specific arguments for each)
- How to retrieve a custom post’s capability?
- Use get_post_types to query only custom posts types
- An empty Custom Post Type Archive page returns 404 in WP 3.1
- Custom Post type with ACF in REST API, how do I get those values?
- is_main_query() not working for WP REST API
- How To Create A Custom Taxonomy 404 Page
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Custom Post Type + 20k posts = blank/404 within Admin edit.php [duplicate]
- WP_Query | ‘post_type’ doesn’t work
- Bizarre Permalinks Issue: 404 Errors Everywhere
- Very simple wordpress block to display posts from an api call
- Add custom parameter to REST API request of a custom post type?
- Custom Taxonomy Invalid in REST API
- How do I get the intended post type of a revision post?
- Using The REST API How To Pull All Custom Posts?
- Custom taxonomy in URL showing 404
- Custom Post Type Draft Preview Goes to 404
- Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)
- WP REST API – reading custom post type
- Wrong request query on cpt and tax
- child of post type (custom)
- 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
- Create a custom post with custom post-metadata with WP API
- Help with Elementor Pagination CPT archive 404 problem
- Getting meta in editor plugin, and event triggering issue