Site logo

Archived topic

Add custom_field.description in category header

7 replies · Started by Raul on August 27, 2017

Viewing posts 1–8 of 8

Hi!

Any way to add {{custom_field.description}} template tag to category page with Custom Headers?

Is important for SEO, add content in category pages.

Thx!!

Currently you would need to create a shortcode which will grab the category description.

However, I like your idea of using {{custom_field.description}}. I'll take a look at this ASAP :)

Great!

For the moment I will create a page-header for each category, with the text style one by one.

Thanks genius :D

You could create a shortcode like this:

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

Then pop this into your Page Header: [term_description]

It works perfect!

Once again, thanks a million ... you're incredible :)

A greeting!

You're very welcome! :)

It doesnt work for me.
Im trying to add Categories Descriptions using this way.
I have added the shortcode using Code Snippets and any descriptions is showed when I add the shortcode [term_description] in the Header Elements

This archived topic is closed to new replies.