I solved my own problem. I needed to put flush_rewrite_rules( false );
after my register_post_type
function. The reason it wasn’t working is because it was returning the page with a 404 error, so I figured out it was a permalinks problem and the code above solved it for me.
Related Posts:
- Where to put my code: plugin or functions.php?
- Should I use custom post types or a custom database tables for plugin development?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Using add_theme_support inside a plugin
- The Great Plugin Nomenclature Contest of 2011
- How to completely disable a taxonomy archive on the frontend?
- How do you create an archive for a custom post type from a plugin?
- How to set a fall back template for a custom post type in a plugin?
- How to add multiple images to custom post type?
- Redirect after deleting post and keep track of pagination
- get_edit_post_link() not working as expected when passed id in plugin
- How do I Make a custom post type get a custom post template in a plugin
- WordPress metabox file upload in custom post [duplicate]
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- WordPress custom post action hook
- Multiple Permalinks for custom post type post
- On clicking on the category name the page is redirecting on 404 pge
- Uploaded image not appearing in custom post type
- Row actions not showing? Why?
- How to: add option to add more checkboxes on custom post type
- how to set default value for checkbox in wordpress
- How to rename image at uploading on specific plugin or post-type in WordPress
- Customize permalink when creating a post
- Custom Taxonomy Not Showing in Menu
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Custom Post Type Navigation on Custom Field
- Plugin translation not working apart from name and description
- WordPress theme custom capabilities not works
- Custom posts don’t work
- How to customize a permalink (URL) structure?
- Orderby CPT custom fields not working
- Update post meta not working in transition_post_status
- Use custom metabox to update automatically a post after a given date
- Addition of custom option panel crashes Media Library & Admin Area
- Custom post type archive page blank
- Custom post listing page layout of custom post type
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Plugin fatal error
- Wrap meta boxes & data handling for specific post types in classes?
- Suggestion on custom post type/ taxonomy relationship
- WordPress custom post type capabilities issue
- HowTo: Custom Post Type (Meta) to Custom Table
- Custom Empty Results page for my Custom Post Type
- How to group navigation items in the admin panel
- How to access the thank you page from the single post?
- How do you make a list and list item relation if custom post types?
- Add form after woocommerce admin order edit
- Custom Meta Box returns no HTML
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Validate Custom Post Type fields
- Is it possible to sort metabox teaxtarea values?
- shopping cart plugin development
- Modify a plugin function output from another plugin
- how can i show a google map in custom post type
- Custom rewrite rules for /pastissues/%category%-%postname%.html
- Content in WP Editor displayed below CPT shortcode [duplicate]
- How add column from new table in Custom Post Listing (admin)
- Writing a custom Glossary plugin
- restricting custom rewrite to just one custom post type
- Change Text in Admin Panel
- allowing custom user role to access custom post type in wordpress admin
- How to show Custom Post Types under Taxonomy in a new WordPress page template?
- Custom Endpoint For Specific Custom Post Type
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- custom post type and user post count shortcode
- How to display the post using a shortcode in WordPress?
- Custom post type specific item design
- Issue removing columns from admin table
- Shortcode and get_template_part
- dynamic vue widget inside custom post
- Getting data from dynamically allocated metaboxes within a custom post
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- WP REST API Custom endpoint don’t work in my plugin
- Insert custom taxonomy into category query
- % encoded URL giving 404 error in WordPress
- how to allow subscriber to add/edit/delete custom post type
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- Custom meta box in editor of custom post type not working
- what file is required to be created in plugin folder in order to show all the post content of a CPT with the help of permalink
- Not Able to Get Custom Post Type in Single and Single-custom-post-type
- Remove Custom Capability
- Can I override the permalink/slug on creation
- call_user_func_array() error after moving to another server
- Displaying multiple custom post types in single post type at admin section
- Custom Post Type Audio Content
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Items By Group added to custom post type
- Custom Taxonomy Showing in WP Menu
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Custom Post Types in plugins?
- Multiple Block Quotes without using HTML
- How to apply order on custom taxonomy and custom meta key on custom post type
- Hide custom post type and use its slug in new plugin menu
- Don’t display post if post has empty body
- Set a Custom Post Type as a Homepage
- Need some hints for my own WP theme development
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- get_post_types() is returning null
- I want to show a list of posts under specified categories
- How to consume external API from WordPress post editor and display the response data in the custom field?