Posted: June 19, 2017 at 9:17 pm
|
Hey I want to set up a calendar to show multiple categories. I tried setting up a parent category for all of the events called main-calendar and using this calendar code |
Hi Wolfpack, Did you actually assign events to the main category? The calendar only shows events that are assigned to a category. It doesn’t show subcategories assigned to a parent category. |
|
|
No they are assigned to the child categories. I want to keep the custom css (color and text color) of each category and show 4 categories on the same calendar. I figured that’s what the parent feature was for (what else would it be used for). How can I get 4 categories to show up on the same calendar? |
The parent/child categories are more for things like URL structure, see also: There really isn’t a way to specify 4 categories to show on one calendar. The calendar shortcodes are limited to either 1 category or all categories. |
|
|
I’m not that good with SQL queries, but couldn’t you find all events where category_id == <selected_id> or where parent_id == <selected_id> and push that functionality up really quick for me to use? I would do it myself but I don’t know wordpress that well. If you point me in the direction of that section of code though I might take a look and see if I can figure it out. |
So right now the There is a filter hook you can use to modify the calendar query, here’s an example that shows how to pass an array of category slugs: https://gist.github.com/joshfeck/8f1e30feae874f9092d61b8ae3bf5f74 You can add the above to a functions plugin. You’ll replace the array of category slugs on line 8 in the example with your array of category slugs. |
|
|
Hey I’ll take a look at the function plugin this week, but the parent category id would work I’m pretty sure, I just took a look in the db and there is a reference to the parent id. I could write a SQL query and give it to you if you want, you would just have to put it where it needs to go in the code. |
Hi wolfpack4417, Tony is actually working on something along these lines. He hasn’t published a branch yet, but if and when that happens the branch will be available here: https://github.com/eventespresso/ee4-events-calendar/branches |
|
The support post ‘Multiple Categories on a Calendar’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.