• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Enable Genesis sidebar extra options inside the block editor for a CPT

Learn in this tutorial how to enable extra options in the Genesis sidebar inside the block editor for a Custom Post Type (CPT) using code.

The Genesis 3.1 release introduced a new Genesis Framework specific sidebar to the WordPress block editor.

genesis-sidebar-block-editor

In it you can control:

  • Hide/show breadcrumbs.
  • Hide/show titles.
  • Hide/show featured images.
  • Page layout.
  • Hide/show footer widgets.
  • Add custom CSS classes.

By default, these options are available for pages or entries.

genesis-sidebar-block-editor

But in this tutorial you will see how to enable them in the Custom Post Type of your choice.

Shall we go there?

Snippet to enable more options in the Genesis sidebar inside the editor for a CPT

Two situations can occur:

  • That the plugin was created by you.
  • Or that it is a plugin from the WordPress repository.

Here is the solution for both possibilities.

1. Custom Post Type

If you used the tutorial to create a CPT using code you don’t need to do anything because that tutorial is already updated and ready for the CPT to display the new editor.

2. CPT plugin created by another developer

If the plugin was developed by a third party, add this snippet in functions.php or to your functionality plugin:

To see this and another 847 code snippets of this website, login or subscribe here.

With this snippet you make the new Genesis sidebar in the editor available for the CPT “Portfolio” (i.e. with the slug “portfolio”).

Of course, I invite you to change it for the one that interests you the most.

genesis-sidebar-editors-blocks-cpt

Conclusions

Do you want all the new Genesis options to appear in your sidebar inside the block editor for one of your CPTs?

Now you know how to selectively enable it through code.

If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.

Benefits of being a subscriber. 🙂

Block Editor CPT Genesis Framework PHP

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?