Site logo

Archived topic

Blog Category description not showing

7 replies · Started by Dominic on June 3, 2020

Viewing posts 1–8 of 8

Hi,

We want to write text on our blog post categories under the field description.
This text when entert is not showing on the front end of the category.

See what I mean: https://www.screencast.com/t/xeWte4m02

How can we fix this?

Thank you for your help

Kind regards,
Dominic

Hi Leo,

thanks for the feedback.

Not being a developer I have no idea what to do with the {{custom_field.name}}

How should I use this and where?

Thank you for your time and help.

Kind regards,
Dominic

Let's try this method.

Add this code:

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();
}

Using one of these methods:
https://docs.generatepress.com/article/adding-php/

Then add the shortcode:
[term_description]

To the header element.

Let me know if this helps :)

thanks
this works :)

It only doesn't display where I want it
https://www.screencast.com/t/QNyeS23CT

Tried it as a hook in the "before main content" but then it just displays the actual shortcode.

How should I proceed?

thanks again for all the help

Make sure to check the Execute Shortcodes option in the Hook Element

This archived topic is closed to new replies.