• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Calgary Wordpress and Genesis Web Development
  • Home
  • News
  • Portfolio
  • Services
  • Contact
  • Code Samples
  1. Home
  2. Tips
  3. Custom Post Type (cpt) – Work with Gutenberg by default.

Custom Post Type (cpt) – Work with Gutenberg by default.

September 17, 2019 By Jamie Kembel

By default, depending on your theme, custom post types will still use the classic post editor in WordPress.

If you are wanting to force blocks (the gutenberg editor) on your custom post type, it is actually SUPER easy.

There are plugins that will do this for you, but if you are like me, and like to limit plugins as much as possible, then here is your simple solution. Yes, it is actually only one line of code in your setup of your custom post type.

Here is what a normal custom post type could look like (this isn’t using all of the features, but this is how I do most of my CPT’s)

add_action( 'init', 'tips_post_type' );
function tips_post_type() {
	register_post_type( 'Tips',
			array(
				'labels' => array(
				'name' => __( 'Tips', 'kembel' ),
				'singular_name' => __( 'Tip', 'kembel' ),
			),
			'exclude_from_search' => false,
			'has_archive' => true,
			'hierarchical' => true,
			'capability_type' => 'page',
			'menu_icon' => 'http://kembel.ca/favicon.ico',
			'public' => true,
			'rewrite' => array( 'slug' => 'tips' ),
			'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
		)
	);
}

Notice in the ‘Supports’ => Array area, that we are adding support for ‘editor’.
You need to make sure this is set, but it should be set already anyways for most CPT’s.

Right above the line for Supports, we want to add this line:

'show_in_rest' => true,

This will now allow the custom post type to use the blocks (gutenberg) editor in the back end of WordPress.

About Jamie Kembel

Jamie Kembel is the primary designer and programmer behind Kembel.ca

Jamie has been building websites and dominating results in Google for more than a decade. Jamie's background supporting small businesses and increasing revenue is supported by his tenure as an executive ownership partner for Canada's largest electronics retailer.

Jamie has earned hands-on experience in branding, marketing, and successful online best-practices.

"It isn't about "getting a website". It is about branding, developing and even more importantly... maintaining an online presence for your company."

Address

23 Walden Place SE
Calgary Alberta
T2X 1Y5

Hours

*By Appointment Only

Copyright © 2025 Kembel Web Design ยท Log in