Archived topic
Display category description in static archive page
5 replies · Started by George on February 26, 2021
I am using the code found in the following link to display categories as static pages:
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/
Is there a way to display a category description inside a block? Maybe through a shortcode?
Hi George,
Something like this?
https://generatepress.com/forums/topic/add-custom_field-description-in-category-header/#post-375162
Something like this but for a static page, I am not using a header, I am using static page archives. The shortcode doesn't do anything. And Tom's code has an error, a ' next to term_id that brings down the site.
Hi there,
you would need to use term_description function and pass it the ID of the category/tag you need to display:
https://developer.wordpress.org/reference/functions/term_description/
Got it, thanks, David!
You're welcome