Home › Forums › Calendar Products › Community Events › Description of Category
- This topic has 5 replies, 4 voices, and was last updated 9 years, 9 months ago by
Rhonda.
-
AuthorPosts
-
June 25, 2016 at 8:48 am #1131883
Rhonda
ParticipantI had a request to include a long description of the category before the events begin listing. I tried inputting the information in the category description but it does not show up on the category list. Is there any way to do this.
June 27, 2016 at 8:30 am #1132344Geoff
MemberHi Rhonda, and hope you had a great weekend!
Good question. None of the templates display the category description by default, but that can certainly be added.
You can add something like this to your theme’s functions.php file and it will display the description:
if( tribe_is_event_query() && is_tax() ) { echo term_description( 'tribe_events_cat' ) }Will this work for you? Please let me know. 🙂
Cheers,
GeoffJune 27, 2016 at 9:07 am #1132383Rhonda
ParticipantI must have added the above code to the wrong section of my website. When I added it to the functions.php under Appearance > Editor > Theme Functions (functions.php) it took the website down. After restoring from a back up, I looked for a functions.php under The Events Calendar plugin, but did not see one.
Thanks so much for your help.
Rhonda
June 27, 2016 at 9:58 am #1132467Geoff
MemberHi Rhonda,
Oh shoot, it appears I led you down a wrong path — I get the same error and should have tested my answer more thoroughly before sharing it. Sorry about that!
On a second look, it appears the cleanest way to get the category description is to add it directly to the template. Our Themer’s Guide provides steps for customizing calendar templates, but it basically boils down to this:
- Make a copy of the template. In this case, let’s add this to the list/content.php template which is located at wp-content/plugins/the-events-calendar/src/views/list/content.php
- Make a new folder in your theme called tribe-events
- Make a new folder in that one called list
- Drop the copied content.php file in that last folder
Now that the template is in your theme, it can be customized to suit your needs. In this case, add the following where you would like the category description to display:
<?php if( is_tax() ) { echo term_description( get_queried_object_id(), 'tribe_events_cat' ); }?>I tested that out and it does seem to do the trick. Please let m know if it works for you as well. 🙂
Cheers!
GeoffJuly 12, 2016 at 9:35 am #1138700Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Description of Category’ is closed to new replies.
