Support

Home Forums Event Espresso Premium Display category description when not events scheduled?

Display category description when not events scheduled?

Posted: May 7, 2013 at 4:20 am


mpurse

May 7, 2013 at 4:20 am

is there a way to display category descriptions when there are not events scheduled?

For example here: https://www.thegoodlifecentre.co.uk/basket-making/


Jonathan Wilson

May 7, 2013 at 2:34 pm

Hello there,

This is possible using our shortcodes on a page for the category you want to display. Then you can put the description within the page content.

See here for a list of shortcodes: https://eventespresso.com/wiki/shortcodes-template-variables/#category


mpurse

May 7, 2013 at 3:06 pm

I am already using the shortcode: [EVENT_LIST category_identifier=”basket-making-1346577507″]


Josh

  • Support Staff

May 7, 2013 at 4:14 pm

There is a setting that you can set to yes in Event Espresso>Categories for each of your categories where you want the description to display. When you go in to edit the category it will say:

Display category description on event listings page?

And if you set it to yes, it will display the description all the time. If you do not want to description to display if there are events listed, then you can modify where it displays the description in event_list.php to check to if there are any events before displaying the description. This is around line 265 of event_list.php, here is some example code:

if ($display_desc == 'Y') {
 	if ( count($events) < 1) {
	echo '<p id="events_category_name-' . $category_id . '" class="events_category_name">' . stripslashes_deep($category_name) . '</p>';
	echo espresso_format_content($category_desc);
	}
}

The support post ‘Display category description when not events scheduled?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso