If you’ve been working on adding a custom post type into your WordPress theme, only to fall flat when, inexplicably, the title and editor in the post edit screen have disappeared, have no fear! Here is the common cause.
If you don’t add ‘supports’ => array( ) into your custom post type registration, then at the very least WordPress assumes you still want to be able to add a title and content for your posts. But let’s say you wanted to add a featured image as well. So you Googled “add featured image option to custom post type” and you found that all you have to do is add this:
1 |
'supports' => array( 'thumbnail' ) |
So you added it. And poof! There goes your title and content editor. The problem is that there are multiple arguments you can put into “supports,” and if you declare it but don’t include those arguments that would have otherwise been enabled, it assumes you don’t want them. Two of those arguments are ‘title’ and ‘editor’. So the solution is simply to add those in, so your code now looks like this:
1 |
'supports' => array( 'title', 'editor', 'thumbnail' ) |
Pretty simple! Hopefully that will fix your problem. If you need additional help with your custom post types, check out the page WordPress has about them or email me at brian@pagecrafter.com or tweet at me at @brianjonline.
7 Comments on “Custom Post Type – Title and Editor Not Displaying – WordPress Tip”
Thank you so much!
I had removed the ‘editor’ from the code along with ‘author’, because I didn’t want to show who authored and edited the posts. And then I couldn’t figure out why I had no no editor to add my content! Haha!
I didn’t find this info anywhere else and was going nuts. So thanks!! :oD
You’re very welcome! I’m glad it helped.
Thank you!!!
Thank you! I’m not sure what happened as I thought the title was displayed before. Maybe a recent WordPress update forced this or maybe I didn’t realize it earlier. Either way, adding ‘title’ to the supports array made it show up. Perfect!
Glad I was able to help 🙂
Thanks save me tooo!!!
Life saver!! 🙂