Posted: August 19, 2016 at 12:04 am
|
If I could impose, I would like your professional opinion on my approach to a body_class filter. Use case: we record some of our events (classes) and I have a “Recording Calendar” where I am displaying expired events with a venue of “Recording” and the video in the description. All good so far. I am using the Divi theme and it sets a body class of “et_right_sidebar”, which is great for upcoming events so I can display the cart widget, but I would like to change the class to “et_full_width_page” for the recorded events so the video is full width. Here is the code I came up with for the filter for your entertainment. Suggestions and criticism requested.
Thank you in advance for your indulgence. |
Hi there, What you have above should work fine but can I ask why you are using a Venue for this rather than a category? |
|
|
Hi Tony, Thanks for the feedback! That was my initial approach; however, we also use categories to organize our classes: Meditation, Tibetan Yoga, etc., and I want to keep the option of adding the category filter to the calendar (will have to disable the display of the venue filter) which is a little confusing when you add “Recording” to the list. So that was the rational…such as it is. Thanks again for your time. Cheers, Mark |
Hi Mark, You could also use the tags taxonomy to classify the “Recording” events. This way you can use the venues for their intended purpose. |
|
|
Hey Josh, I looked into that as well but if memory serves the calendar shortcodes did/do not allow to filter on tags. I’m comfortable designating venue to this purpose since we only have three classrooms and what’s where is a bit on the fluid side; I’d rather not parade our indecision…. I really appreciate the feedback! Cheers, Mark |
You’re welcome. |
|
The support post ‘Sanity check on a body_class filter’ 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.