Home › Forums › Calendar Products › Events Calendar PRO › Category Countdown
- This topic has 5 replies, 3 voices, and was last updated 7 years, 11 months ago by Support Droid.
-
AuthorPosts
-
May 2, 2016 at 10:49 pm #1109888WyattParticipant
I’m trying to find out how to show an event countdown by category. We currently have 5 different categories, so my goal is to have a separate widget for each category that would show on their respective pages.
I created a “text” widget using this short code, but it’s still not working for me. [tribe_event_countdown category=”Tour”]
Please help.
May 3, 2016 at 6:02 am #1109948JoshParticipantHey Eric,
Unfortunately there isn’t a “category” attribute for the countdown widget so you wouldn’t be able to get the events you’re looking for with the settings you have above.
An option would be to create a sort of wrapper shortcode. that would allow you to select the category, run a new query based on that and then pass the appropriate “id” into the countdown shortcode to display a specific event.
An example of this would be:
https://gist.github.com/BeardedGinger/7b6274c6b0859b0bd37ecb646c7eb7b4
With that you could use [countdown_by_category category=”tour”] to display the countdown for the latest event in the “tour” category.
Let me know if this helps.
Thanks!
May 3, 2016 at 6:31 am #1109960WyattParticipantOk perfect. So would I create an new PHP file?
Or where would I copy this code to so I can use the shortcake?
Would I add it to the bottom of this file: config-events-calendar/config.php
Thanks again for helping me with this.
- This reply was modified 7 years, 11 months ago by Wyatt.
May 4, 2016 at 6:42 am #1110409WyattParticipantPlease help… Where should this code live?
May 4, 2016 at 8:35 am #1110495JoshParticipantHey Eric,
The code would be added to your child theme’s functions.php file. You can include it at the end of your file, ensuring that it doesn’t fall within another function. Additionally, the snippet above includes an opening “<?php” tag. You don’t want to add that into the file when pasting in your snippet.
If you’re uncomfortable with adding snippets to your functions file, you can try a plugin such as this to add the snippets to your site.
Let me know if this helps.
Thanks!
May 19, 2016 at 9:35 am #1116471Support DroidKeymasterThis 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 ‘Category Countdown’ is closed to new replies.