Modifying table.php and tribe_calendar_grid()

Home Forums Calendar Products Events Calendar PRO Modifying table.php and tribe_calendar_grid()

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20869
    Andrew
    Member

    I followed the directions in this post: https://theeventscalendar.com/support/forums/topic/embed-calendar-in-page-but-only-show-one-category/ to create a way to display a calendar w/ only one category, however, I need the ability to do this in other places in the site as well for other categories, in particular, in posts and pages.

    I came up with this solution: http://pastebin.com/q4ZD0GdU and I init it using code like this in the template:

    global $tbocc_event_cat;
    $tbocc_event_cat = 245;
    tribe_calendar_grid();

    This works fine in the template, but if I use a php execution plugin to allow me to use this in a post or page, the calendar that is displayed shows all events.

    Why does this work in a template but not in a page? I am guessing it’s because in a page it’s inside the loop whereas when I’m using it in the template it’s not?

    What would I need to do to make this work? Feel free to improve it as well, this is a dirty hack I know. 🙂

    #20947
    Joyce Grace
    Member

    Hi Andrew!
    Thanks for posting here. It’s great you found some tutorials already. I’m curious, have you checked out our Themer’s guide to customizing the events calendar? https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/

    It might not have the exact answer you’re looking for but maybe it will help lead you in the right direction.

    I will also see if Jonah has any input.

    #21136
    Jonah
    Participant

    Hi Andrew,

    I’m not quite sure why this isn’t working for you although it probably has something to do with it being inside the loop. Unfortunately we do not have the resources to be able to support customization like this so you’re on your own. One thing that might help you is the Debug Bar (http://wordpress.org/extend/plugins/debug-bar/) and Debug Bar Extender (http://wordpress.org/extend/plugins/debug-bar-extender/) plugins to help you troubleshoot the current query and variables.

    Good luck and please do post back here if you have any success!

    Thanks,
    Jonah

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Modifying table.php and tribe_calendar_grid()’ is closed to new replies.