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:
- How do I change the author of a custom post type?
- How to add a button to custom post type’s posts-page
- Creating a custom public user page
- Redirect after deleting post and keep track of pagination
- get_edit_post_link() not working as expected when passed id in plugin
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- Remove Slug from Custom Post Type results in 404
- Unable to filter on field on edit.php page
- Insert slider (Custom Post Type) into pages
- How do I create a custom post type for a training CMS in WordPress?
- WP Query group/order by category name
- Save or update data when custom post published
- Using posts and postmeta table to store custom Address Book Plugin data
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to add multiple featured image in meta box in post editor?
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- how to set default value for checkbox in wordpress
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How do I set the link in the Custom Post Type admin menu?
- How to List Thumbnails based on Custom Categories
- Adding Meta Boxes while Registering a Post Type in a Class
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- Custom Taxonomy Not Showing in Menu
- Set object terms not working on plugin activation
- Using custom page templates with plugin [duplicate]
- Get all of user’s custom post types in WP Admin for plugin
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Custom Post Type: Upload Multiple Images
- WordPress theme custom capabilities not works
- How to add a custom taxonomy to show up in a custom post type menu?
- Give a permalink to Custom Post Types without title
- Getting template_include to work when allow_url_include is off?
- WordPress post_where & posts_join not working only for custom post type
- Use custom metabox to update automatically a post after a given date
- Custom Permalink to remove category word , keeping posts permalink with date?
- Form action/link to render a plugin in WordPress front-end
- How to Create a WordPress Plugin With Custom Post Type/Custom Field Features?
- Adding a metabox on a CPT’s submenu page
- Custom fields for custom post type
- Save Multiple Metabox values
- ACF in wordpress
- Theme independent plugin by using default page template
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- post_parent in custom post type
- What’s an efficient way to change the post status of many posts at once?
- Dynamically insert code to custom post type loop
- How exclude or skip post type with get_next_post_link
- How do I add custom HTML to the content of an archive page’s posts?
- Unable to format dates to put in event calendar
- How to add query args to links to CPT admin submenu
- Dynamic assign a custom template to custom post type posts
- How to add and display custom content that is not a post
- Custom post type in Custom widget – $listItem
- Problem with adding custom post type meta to header by plugin
- Creating alternate meta box context locations
- Types plugin custom post add_action hooks
- Convert Custom Table Data Based Plugin To Be Searchable
- Limiting Amount of Posts in a Custom Post Type again
- Not Able to Add New Class To CPT Attachment Image
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Orderby custom fields is not working
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- How to stop the custom post type URL from the google search?
- How to add a default predefined thumbnail when creating a brand new post?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- URL issue retrieving Custom Post Types using Backbone JS API
- WordPress Custom Post Loop
- Changing CPT permalink
- Correct way adding External classes to Custom Post type and output their methods to template
- Get all posts by many custom post types
- ‘Simple’ Reservation System
- Warning , Use of undefined constant PLUGIN_PATH?
- Show Post columns to specific users on condition
- Error when moving custom post type to bin
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Having issue on Loading Meta Data From CSV to CPT
- custom data model – link and populate from admin backend
- Custom Post type plugin is using theme single.php and style.css
- php output of generated custom metabox
- call a function when insert and update a custom post type
- Can’t save custom post type fields
- Registering an optional custom post type from a plugin
- Shortcode error
- Generate custom RSS from a plugin
- Issue on Counting CPT’s Under Taxonomy Term
- Get term_id for each instance of custom taxonomy
- How to internationalize the sub menu name “categories” in Custom post type?
- Creating a Custom Post Type as a Plugin? Why?
- WordPress Roles
- How to separate posts by categories?
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- Custom post type template not loading from plugin
- I am having a problem with fetching product data in the Gutenberg block editor
- Add block templates (html) via plugin for custom post type
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- REST API callback function is not called
- Display box in sidebar of custom post type
- Remove `View post` Text
- Add taxonomy or category slug to custom post types URL