Display category description in Pro (Ethos)

Hi, please can you tell me if it is possible to get the category description on the categories

I don’t even have the category title showing, that would be a start :slight_smile:

Hello There,

Thanks for writing in!

It seems that your server is down.

Please contact your hosting provider and tell them that your site is down.

Please let us know how it goes.

just a glitch, it is up now.

Hey @lisacole1,

There is no option to show the category description in Pro and the category title is only available in the Classic Header. In the future, there might be an official way where you can add a dynamic title to a text element to display the archive title and description but for now, this will need some custom shortcodes. Please see this screencast first to get an idea of how it will work. The shortcodes in that screencasts are [page_title] and [archive_desc]. I’ll provide you with the code I used for testing but please note that this may or may not work in your site and it would be your responsibility to integrate, maintain and fix the code if it breaks in the future as the code only serves as a guide. Here’s the code you need to add in your functions.php.

add_filter( 'get_the_archive_title', function ( $title ) {

    if( is_archive() || is_post_type_archive('x-portfolio') ) {

        $title = single_cat_title( '', false );

    }

    return $title;

});

function page_title_shortcode( ){
	if (is_archive()) {
		return get_the_archive_title();
	} else {
		return get_the_title();
	}
}
add_shortcode( 'page_title', 'page_title_shortcode' );

function archive_desc_shortcode( ){
	return category_description();
}
add_shortcode( 'archive_desc', 'archive_desc_shortcode' );

Hope that helps.

thank you but that is way too scary, I’ll use essential grid on pages instead :slight_smile: It would be a brilliant feature for the future though

Hi there,

Noted that, and yes, you may use Essential Grid for now.

Thanks!

If I tried this, would it let me edit the category page and put in normal content, like a post or page?

I’m not sure what you mean by normal content but the default WordPress editor is enabled for the Description.

Thanks.

ohhhh, thank you!

1 Like