Category Countdown

Home Forums Calendar Products Events Calendar PRO Category Countdown

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1109888
    Wyatt
    Participant

    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.

    #1109948
    Josh
    Participant

    Hey 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!

    #1109960
    Wyatt
    Participant

    Ok 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.
    #1110409
    Wyatt
    Participant

    Please help… Where should this code live?

    #1110495
    Josh
    Participant

    Hey 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!

    #1116471
    Support Droid
    Keymaster

    This 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Category Countdown’ is closed to new replies.