- This topic has 7 replies, 5 voices, and was last updated 1 year, 10 months ago by Michael.
-
AuthorPosts
-
December 27, 2019 at 9:16 pm #1115663Vijay
I am loving the flexibility of the block editor with the layout capabilities of GeneratePress.
However, category description is using the Classic Editor.
Wondering if it is possible to enable the block editor for such category pages as well?
December 27, 2019 at 9:36 pm #1115670LeoStaffCustomer SupportHi there,
This isn’t the theme can do as it’s handled by WordPress.
Looks like someone already mentioned it to WordPress:
https://github.com/WordPress/gutenberg/issues/12511March 15, 2021 at 2:54 pm #1696532twarriorHow you get to show the Classic Editor in the category description?
March 15, 2021 at 4:12 pm #1696586YingStaffCustomer SupportI think you will need some kind of plugin to give the flexibility to edit category descriptions ๐
March 15, 2021 at 6:11 pm #1696665VijayMarch 15, 2021 at 10:07 pm #1696749ElvinStaffCustomer SupportHi there,
There’s actually a way to use Block Element and its contents as for the category description but it has its drawbacks.
First, we can allow shortcodes to run on category description field.
We can do that by adding these PHP snippets:
add_filter( 'term_description', 'shortcode_unautop' ); add_filter( 'term_description', 'do_shortcode' ); remove_filter( 'pre_term_description', 'wp_filter_kses' );
We then create a shortcode to allow us to create portable hooks anywhere it’s placed.
add_shortcode('portable_hook', function($atts){ ob_start(); $atts = shortcode_atts( array( 'hook_name' => 'no foo' ), $atts, 'portable_hook' ); do_action($atts['hook_name']); return ob_get_clean(); });
Usage:
[portable_hook hook_name="my_custom_hook"]
You can use this shortcode on a category description as shown here:
https://share.getcloudapp.com/12uoW914Now we can create a Block element we can hook into
my_custom_hook
.Here’s an example: https://share.getcloudapp.com/nOuljEN2
After saving, the block element should appear as the category description.
With this, you can name the hooks unique for each category. You can also make a block element for each category description. ๐
I understand that this seems pretty advances and it has its drawbacks(you have to create multiple block elements) but if you want to use Gutenberg for the category description, this could work.
March 16, 2021 at 6:01 am #1697200twarriorClassic editor is default for Post Categories and Tags.
Sorry, but in your first image there is an editor, and in the second one no.
By default, worpress dont show any editor in the category description. Maybe you installed a plugin?
[url=https://ibb.co/Tgr8rcY][img]https://i.ibb.co/tJ3s3BQ/Captura-de-pantalla-2021-03-16-145924.png[/img][/url]
May 6, 2022 at 2:06 am #2211198MichaelThis is the plugin to allow editing category description using the Classic Editor
https://pe.wordpress.org/plugins/categorytinymce/
I’m not sure if it works with current versions.I will be much happier when WP adds block editor functionality!
MIK
-
AuthorPosts
- You must be logged in to reply to this topic.