what’s the add action at the bottom doing? It’s not required for setting up CPTs, just the setup bit you have running on init…. I believe that is what’s throwing the error
I have to make it an answer. It was a suggestion, but if it worked for you, I’ll make my comment an answer, then you can accept it!
Related Posts:
- Search that will look in custom field, post title and post content
- Get custom post type by category in a page template
- Is it possible to create an “export to PDF” option?
- Date archives for custom post type
- If featured image doesn’t exist, show post content
- The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null
- Clean URL permalink for custom post type
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- WP insert post PHP function dynamically generated Custom Fields
- Inserting data into `post meta` table?
- Error after deleting Custom Post Type with a function (no trash used)
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- How to append element after thumbnail
- Using WPAlchemy metabox values in another metabox
- Check Title Unique Or Not and If not error message and dont save
- I am having a problem with form updating/editing WordPress post on the frontend
- GravityForm: Populate Dropdown with custom post type [closed]
- How to output wordpress custom tags separated by comma?
- Custom Post Type without an archive page
- Admin notice not displaying
- Dynamic page outside WordPress
- Custom query to filter posts that have current post as a taxonomy [closed]
- Pagination for custom php code
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Loop throws 500 error when used in widget
- Troubles with saving metabox
- AJAX load more for different custom post type loops
- I need to add endpoint for wordpress categories
- Changing wordpress publication date to ACF date and time picker date not working
- Trouble with CPT Child 404
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- creat filter with wp_query
- WordPress custom post type permalink rewrite shows page not found
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Hide a widget inside a div on specific type of post
- How to import a custom MySQL DB table into a WordPress custom post type
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Foreach inside shortcode not working as planned
- Problems wp_insert_post and save_posts filter
- categories should be available across all custom post types
- Cant get paginations on single.php to work with my custom post types
- How can I group posts by months and years?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- Custom Post not working as expected
- Saving fields in a drop-down in WordPress
- Assigning a category to a custom post type in WordPress
- Show current custom taxonomy
- finding and using post type fields in WordPress
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Show message when query has no posts
- Query entries from custom post type in an ACF flexible content field
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- post_content is stripping HTML when adding a new post? [closed]
- Querying a custom post type, but not show duplicates
- Template code to split a post and print a custom field?
- Accessing a protected property of a post
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Creating on-page options for Custom Post Type
- Post type Echo code is repeating on homepage
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- How can I increase the post count for custom post types only?
- WordPress sitemap with Custom Post Types
- How can I sort the order of multiple custom field values in a custom post type?
- How do I call the custom Post Type name and permanent link to my php file?
- count & sum the value of custom field of the author post in dynamic posts
- Is it possible to hide nav menu items only when they are page titles (on specific templates) but not on the dashboard?
- Grouping custom wordpress post types by acf value
- Show code dependant on CPT & category
- Adding featured image to a new post using front-end form?
- WordPress – display relationship between blog posts and custom posts
- when looping through custom post data not appearing
- Getting a Post ID to show its content in a Popup
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- Load info from customposttype into template page
- Visualize info in just custom post_type in theme
- cpt not display inside nav menu
- Disable Sidebar on certain pages
- Show parent category and subcategory once in while loop
- How to get the posts that my following users are liked?
- Display related post content and custom field content
- The most recent post of custom taxonomy
- Custom 404 redirect for a luddite
- Show tags of custom post types in WordPress
- can’t see categories in appearance-menu-categories
- wordpress form processing to custom post type not working
- WordPress custom field images not getting inserted into array
- Meta-Box to add multiple items one at a time and on publish save all
- Values inside a custom field to determine which category posts to display
- Posts without featured image using other post’s featured image
- Add number in increment of one to DIV ID
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- What is the most efficient way to manage changes my product comparison tables?
- Dynamically change Custom Post Type Template OR Change Permalink?
- Store custom post type with JSON content
- Custom Post Type slug has the same Redirection entry
- Adding a new custom post type using the editor causes 502 bad gateway error