• I need to add some content to the category description, and importantly include a reusable block.

    It isn’t obvious where in the category description I can choose blocks and/or reusable blocks. I just see the old editor not the block editor and that old style one doesn’t allow me to use the blocks.

    Can someone please help? Thanks

    • This topic was modified 2 years, 5 months ago by Mr Lucky.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The category description field is just a textarea form field, it’s not any sort of editor at all. Even if you copied the relevant block code from the block editor and pasted it into the description field, it wouldn’t be processed as a block, it’d appear as plaintext.

    If you wanted block code to be processed as a block, perhaps altering the theme’s category template to apply “the_content” filter to the description prior to output would cause it to be treated as a block instead of plaintext. I’m not sure this would actually work, but it’s a reasonable thing to try before resorting to something more complex. Having to copy/paste block code isn’t ideal anyway.

    A more complex solution might be to create a custom post type whose purpose is to serve as the description for a particular category term. Then you can use the block editor to create descriptions. The category template would then be modified to get the related post content for a description instead of using the term’s default description field.

Viewing 1 replies (of 1 total)
  • The topic ‘Blocks in category description’ is closed to new replies.