Archived topic
Add custom_field.description in category header
7 replies · Started by Raul on August 27, 2017
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
Replied to your own topic here:
https://generatepress.com/forums/topic/show-category-description-in-elements-header/#post-1053187
Please keep the conversation there.
Thanks :)