Home › Forums › Calendar Products › Events Calendar PRO › Embed calendar in page but only show one category
- This topic has 10 replies, 5 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
January 27, 2012 at 12:47 pm #14286
Trevor
MemberHi, I’m able to embed a calendar into a page template with tribe_calendar_grid(), but I need to edit it so the calendar only shows one category… is that possible?
January 30, 2012 at 7:42 am #14358Rob
MemberIt should be. Have you checked out our documentation at https://theeventscalendar.com/support/documentation, to see if that points you in the right direction? Let me know if not and I can get a dev to take a look.
January 30, 2012 at 7:44 am #14360Trevor
MemberYep, been looking through the KB and FAQ… This is all it lists for that function. It doesn’t appear to offer a way to pass any variables (like the category).
Calendar Grid (Display)
tribe_calendar_grid()
Display the full size grid calendar tableReturns
void
More Info
since: 2.0
uses: load_template()January 30, 2012 at 1:52 pm #14390Trevor
MemberI tried using:
set_query_var(‘eventCat’,6);
tribe_calendar_grid();I’m thinking I need to modify the table.php file, but I can’t figure out the best way to do that, and I’m not sure how to override that file.
January 30, 2012 at 4:44 pm #14399Rob
MemberAlright, thanks for confirming. I’ll get Jonah to take a look this afternoon.
January 30, 2012 at 9:36 pm #14415Jonah
ParticipantHey Trevor,
You should be able to do this by editing table.php like you suspected. First make a duplicate copy and place in an ‘events’ folder in your theme if you don’t already have one. Then on line 20 modify:
$eventPosts = tribe_get_events(array( 'eventDisplay'=>'month' ));
to:
$eventPosts = tribe_get_events(array(
'eventDisplay'=>'month',
'tax_query'=>array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'id',
'terms' => 4,
'operator' => 'IN'
)
)
));
Where ‘4’ for terms is the ID of your event category you want to include.
April 26, 2012 at 6:33 am #18303Javier
ParticipantCan I do the same in the table-mini?
April 26, 2012 at 7:14 am #18305Jonah
ParticipantYes, the same thing can be done in table-mini. Just make a copy of /wp-content/plugins/the-events-calendar/views/table-mini.php and place in the ‘events’ folder in your theme. On line 12 is where tribe_get_events is called so just modify the parameters being passed in there and you’re good to go!
April 26, 2012 at 12:09 pm #18320Javier
Participant@Jonah Thanks Jonah! I’ve got another discussion opened, is really important for me, it is for a SEO purpose.
Thanks
April 26, 2012 at 3:36 pm #18342Rob
MemberThanks for confirming this did the trick, Javier. Per my note a minute ago we’ll respond to your other thread as soon as we can.
July 7, 2015 at 6:19 am #976671Support 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 ‘Embed calendar in page but only show one category’ is closed to new replies.
