Site logo

Archived topic

Add Category Description

5 replies · Started by Alessandro on November 17, 2020

Viewing posts 1–6 of 6

Hi, i want to insert the category description in the category page.

I have insert this shortcode in functions.php (child):

add_shortcode( 'term_description', 'tu_term_description' );
function tu_term_description() {
    ob_start();
    echo term_description( get_queried_object()->term_id, 'category' );
    return ob_get_clean();
}

https://generatepress.com/forums/topic/blog-category-description-not-showing/#post-1313027

Why don't work?

Hi there,

did you add the Shortcode: [term_description] to the Header Element content ?

No I did not. How should it be created?

Go to Appearance > Elements and edit the Header Element you have assigned to your archives.
Below the Title HTML insert: [term_description]

Thank you David, now Work! :)

Glad to hear that!

This archived topic is closed to new replies.