In your code where you defined your custom post type (in a custom plugin or in your functions.phpfile), you need to add this snippet for Gutenberg block editor support:
'show_in_rest' => true,
'supports' => array('editor')
Here is an example:
function portfolio_post_type() {
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio' )
),
'has_archive' => true,
'public' => true,
'rewrite' => array('slug' => 'portfolio'),
'show_in_rest' => true,
'supports' => array('editor')
)
);
}
add_action( 'init', 'portfolio_post_type' );
Related Posts:
- Enable Gutenberg on custom post type
- Creating conditional blocks for WordPress Gutenberg
- Hide “Add media”, HTML editor from TinyMCE
- Add class to Gutenberg Editor for Custom Post Types
- How to filter by custom post type on Gutenberg “Latest Posts’ block
- Gutenberg: Sidebar for specific post type
- Numbering sections and block-level elements in wpautop(); WordPress as CMS for long-form writing;
- Gutenberg how to make attribute to save to meta
- How to add button to post page WordPress 5.x
- WordPress Gutenberg-Block with ESNext (withState, withSelect)
- Remove tinyMCE from admin and replace with textarea
- The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null
- Display different gutenberg template from selected post attributes
- Using multiple instances of wp_editor in Custom Post Type admin area
- Excluding post type from WordPress link builder
- WordPress Rest API only returns content when posttype has editor capability
- Lock post meta block at the bottom of a custom post type
- How can I list all custom post types in a block
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- Adding a Gutenberg-like custom field on a custom post type
- Classic editor showing in Gutenberg when creating a custom post type
- Creating template with h3 block (block editor)
- How To Enable Block Editor (Gutenberg) for Existing Post Type via functions.php
- How to make a custom taxonomy selectable in post publish area?
- Add TinyMCE to CPT metaboxes in 3.1?
- show_in_rest false disable Gutenberg
- I can’t choose the custom taxonomy in my custom post type on Gutenberg
- Parent field missing from custom post type in the block editor
- How to get the parent of a non-hierarchical custom post type being edited in Gutenberg
- post_type_link not working in gutenberg
- Multiple TinyMCE editors in dynamically generated textareas
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Visual editor issue by having multiple tiny mce editors in a CPT
- Getting meta in editor plugin, and event triggering issue
- Save the post parent in a custom post type in Gutenberg
- WordPress CPT save metadata in gutenberg
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- Query Post Object in WP Admin
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Show image gallery from a custom field
- How to use TinyMCE Editor for one of my custom post meta field?
- TinyMCE style formats for different post types
- P̶l̶a̶c̶e̶h̶o̶l̶d̶e̶r̶ *Default* content in Custom Post Type TinyMCE editor
- How can I set the height of the classic editor per post-type?
- Combine multiple getEntityRecords calls
- Use core block functionality in a custom block gutenberg
- gutenberg message
- How do I assign a block template (.html) to a custom post type?
- Adding custom post formatting options in custom post types
- How to save TinyMCE fields on WordPress custom post type?
- Custom post type set default template using block editor
- CPT: Enable Gutenberg, but disable editor field
- Select custom post type do display from page editor
- How add Filter by Tags and by categories to custom post type in Gutenberg block
- Is it possible to add the Gutenberg block editor to a custom taxonomy?
- How to debug failing updates for custom post type?
- Some posts not displaying by taxonomy term
- Multiple Block Quotes without using HTML
- Can you programme the selected page template to display block patterns automatically?
- Possible to limit internal link search to post types with Gutenberg editor?
- Issue displaying multiple TinyMCE editors with WPAlchemy
- Custom Gutenberg block problem – This block has encountered an error and cannot be previewed
- getEntityRecords/useEntityRecords: How to use CPT metadata?
- Custom Block: Adding “Post Type” dropdown to Sidebar Settings
- Post term block variations not generated for custom taxonomies
- Can’t publish custom type posts that don’t support title and editor, instead they’re saved as draft
- Put update-like notification bubble on multiple CPTs menus for pending items
- Help with a TV series Rewrite structure
- Passing Variable as URL Parameter — Security concerns?
- Pagination go to first page if i’m on last post
- Grossly inefficient wordpress loops!
- Custom Select Query with Custom Post Types
- Category and post tag archives do not include posts from custom post type
- Displaying different custom post types under one admin menu
- Can I change the slug of my archive page on a Custom post type?
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to set up htaccess to redirect a particular post type or subdirectory to HTTPS?
- How Can I Set the Post Author of a Post I Just Created With PHP?
- Cherry framework adding custom post type
- Include custom post type single template, but respect theme override of template if it exists
- How to have custom post type /example/ and then posts /example/posts.html
- Cannot add custom field to “orderby” parameter in Rest API
- Not Able to Get Custom Post Type Gallery Images URL
- Building a Treatments Page, What Do I Use?
- How do I programmatically create new posts of a custom post type over the XML-RPC API?
- How to solve this custom post type goes to 404 page?
- Forms and WordPress Nonce
- List child categories from parent category on custom taxonomy page
- Custom post type – change name in sidebar
- Create a custom taxonomy template that loops through child categories in term order?
- How to create a permalink structure with custom taxonomies and custom post types
- Permalinks change when edit published post on custom post type
- How to create new permission for custom post types for doing specific tasks
- Edit is changing my custom’s post type parent id
- Hierarchical taxonomy in permalink structure
- Change custom post status to draft before today
- Sort custom post type items by taxonomy description
- Loop to pull content from parent element in custom post type [duplicate]
- How to create custom page templates with default page layout framework?
- WordPress Loop trouble with ACF [closed]