WPITECHWPITECH

    Subscribe to Updates

    Get Latest WordPress Tutorials and Updates

    What's Hot

    12 Best Ecommerce Software in 2021 & in the Future

    July 31, 2021

    Why Is My Canon Printer Not Printing Properly?

    July 31, 2021

    5 Best Google Analytics Plugins

    May 28, 2021
    Facebook Twitter Instagram
    Facebook Twitter Instagram
    WPITECH WPITECH
    Subscribe
    • Home
    • Tutorials
      • WordPress Tutorials
      • WordPress Plugin
      • WordPress Themes
      • WooCommerce
      • Ecommerce
      • PHP
    • Hosting
    • Deals
      • Hosting Deals
    • SEO TOOLS
      • Bulk Url Checker
      • Structured Data
      • Google Cache
      • Hyperlink Generator
      • Free URL Checker
    • Marketing
      • SEO
      • Advertising
    • Reviews
    • Write for Us
    • About Us
    WPITECHWPITECH
    Home » Enable Gutenberg Editor in Custom Post Types
    WordPress Tutorials

    Enable Gutenberg Editor in Custom Post Types

    WPITECHBy WPITECHApril 1, 2019No Comments1 Min Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Share
    Facebook Twitter LinkedIn Pinterest Email

    In this tutorial, we will see how to enable the new Gutenberg editor in our Custom Post Types.

    First we must go to the file where it belongs to our Custom Post Type, in the type path:

    Domain.com -> wp-content -> plugins -> CPT> custom_post_type.php

    Edit the php file, which will have a similar similarity to the following Custom Post Type of Courses:

    add_action ('init', 'create_a_cpt'); 
    function create_a_cpt () { 
         $ args = array ( 
         'public' => true, 
         'label' => 'Courses', 
         ' menu_icon '=>' dashicons-info ', 
         ' has_archive '=> true, 
         ' capability_type '=>' post ', 
         ' menu_position '=> 2, 
         ' show_in_rest '=> true, 
    ); 
    register_post_type ('courses', $ args); 
    }

    Well, we must add the argument of:

    'show_in_rest' => true,

    editor_gutenberg_custom_post_types_wordpress

    This will make the classic editor of all life in WordPress, is transformed into the new editor of Gutenberg, as we have in the Posts of our site.

    enable Gutenberg editor Gutenberg editor WordPress custom post types
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    WPITECH

    Related Posts

    9 Amazing Benefits of Using WordPress for Your Projects

    May 15, 2021

    Must have Features for WordPress Website

    February 4, 2020

    WordPress vs Squarespace: Best Comparison 2020

    January 6, 2020
    Add A Comment

    Leave A Reply Cancel Reply

    Recent Posts
    • 12 Best Ecommerce Software in 2021 & in the Future
    • Why Is My Canon Printer Not Printing Properly?
    • 5 Best Google Analytics Plugins
    • 12 Best Email List Building Tools in 2021
    • 9 Amazing Benefits of Using WordPress for Your Projects
    Recent Comments
    • 20+ Top Ecommerce Marketing Agencies To Hire for 2020 on Conversion Rate Optimization Tips to Improve Conversions and Increase Revenue
    • Hottest B2B Content Marketing Trends and Statistics in 2019 on The Ultimate Guide to Broken Link Building 2020
    • Digital Chetan on SEO 2020 Google RankBrain Algorithm GUIDE
    Editors Picks
    Top Reviews
    Advertisement
    Demo
    Facebook Twitter Instagram Pinterest Vimeo YouTube
    • Home
    © 2022 All rights reserved

    Type above and press Enter to search. Press Esc to cancel.