In your code where you defined your custom post type (in a custom plugin or in your functions.php
file), 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
- next_post_link() not working for single custom post type post
- How to set a default format for a custom post type?
- Exclude add_filter from the admin
- Undefined property: stdClass::$labels in general-template.php post_type_archive_title()
- Sanitizing post content for use in an email
- Genesis Child and Custom Post Type
- Display “Post 2 of 4” on single post page?
- WordPress import not importing custom taxonomy
- How to make post sticky in the admin page?
- Remove base slug in permalinks of hierarchical custom post type
- How can I move a custom taxonomy and its data from one post type to another?
- rewrite custom post type slug in wp admin
- Displaying the type of post (Custom) in a single.php
- If Statement – if current post is a child of a post with a taxonomy
- Register widget only page is a singular of custom post type
- Including metaboxes from custom post types in global search — continued
- CPT’s with landing page instead of archive – Url Rewrite?
- How to produce a sub-page-system in WordPress
- Custom post type, have only my meta boxes
- List categories, subcategories and posts from custom taxonomy and custom post type
- Shortcode is displaying the content on top of the page [duplicate]
- How to list top 5 custom post types depending on comments?
- How can I get some of a posts meta data whilst it is still inserting?
- Archive page for custom post type and custom taxonomy
- Creating an Events Feed with Sub Pages/Posts for Each Event
- Problem with custom loop navigation inside the blog page
- WordPress giving me the index
- How to customize custom post type’s list table?
- Trying to list years (for a filter) but not all years display
- customize Dokan multi vendor: how can i set every Dokan as child of another dokan?
- Why do my custom post types stop displaying over time?
- Persist meta box choices throughout all posts of same post type
- Custom post type archive false is not compatible with breadcrumbs
- Single page archive – get coresponding taxonomy and terms
- Custom WordPress URL
- How to assign custom post template to its custom taxonomy terms
- Custom Post Type Loop breaking php
- Custom Post Types Permalink