Category selection or category widget

Home Forums Calendar Products Events Calendar PRO Category selection or category widget

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #28392
    bikoa
    Participant

    Hi;

    We need to filtrate events by category. There are 2 options: In the main calendar, add another select bar with different categories or add a widget with events categories.

    Another question: is posible to show the event category in the calendar pop-up?

    Thanks!!!!

    #28399
    Jonah
    Participant

    Hi Bikoa,

    You can easily add a list of categories that people can click on anywhere on your website with the following snippet: https://gist.github.com/2019513 – you could put this at the top of your calendar page by making a copy of /wp-content/plugins/the-events-calendar/views/gridview.php and placing in an ‘events’ folder in your theme. You’ll need to apply whatever styling you want to the category bar to get it to look the way you want.

    To affect the calendar popup you’ll need to make a copy of /wp-content/plugins/the-events-calendar/views/table.php and place in an ‘events’ folder in your theme. You can get the event categories using the following snippet: https://gist.github.com/2967263 – place that around line 136 in table.php to add the category for the event in the popup.

    I hope that helps!

    – Jonah

    #28471
    bikoa
    Participant

    Hi Jonah!
    Your tips where very useful, but we have another problem:
    – How can we show past events categories? It is to make simpliest category navigation.
    – How can we show private events categories?

    Thanks, thanks, thanks!!!

    #28477
    Jonah
    Participant

    Hi Bikoa,

    That is a little more advanced and not something I will be able to help you with but basically you would need to do a double query, first querying events by past and by category and then from those results get the categories for those events. To query events you can either use our built in tribe_get_events() function (https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events) or WP_Query querying for the ‘tribe_events’ post type.

    I hope that helps but let me know if you have any other questions.

    Thanks,
    Jonah

    #28747
    Darius
    Participant

    Quick question, Jonah… how do I tweak this if I want the category to show up even if there is no upcoming event in the category?

    #28761
    Jonah
    Participant

    Hi Darius,

    You’ll want to first query the category using get_terms() (http://codex.wordpress.org/Function_Reference/get_terms) and then your posts query within that. Here is a sample of some code that should help you: http://snippi.com/s/3a1eh1q

    I hope that helps!

    – Jonah

    #28772
    Darius
    Participant

    I’m not sure if I was supposed to do something extra to the code you provided but it seems to be doing the same thing as the snippet of code found here: https://gist.github.com/2019513 – except that it adds “Upcoming Events” to the output and uses that for the link instead of the name of the category.

    It seems the only way the category shows up is if there has been an event added to that category. Categories that have not had events added to it yet don’t show up.

    That being said, the category does show if that event has passed as long as it hasn’t been moved to the trash. HOWEVER, when I click that category, it shows the category heading and category list twice. Here’s how I edited my list.php file – http://snippi.com/s/a5cdxwp

    #28775
    Darius
    Participant

    Okay… disregard my issue – I’m going to take the route of hard coding the category list with HTML using the category slugs as found here: https://theeventscalendar.com/support/forums/topic/displaying-all-events-in-a-category-in-events-list-view/ This basically gives me exactly what I wanted. (I think) LOL.

    #28778
    Jonah
    Participant

    Hi Darius, sounds good, let us know if there’s anything else we can do for you.

    – Jonah

    #978263
    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 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Category selection or category widget’ is closed to new replies.