Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('body_class', 'remove_sidebar_class_for_month_view', 50);
- /**
- * Remove the .sidebar body class from month view.
- */
- function remove_sidebar_class_for_month_view(array $classes) {
- // Don't interfere if the request does not relate to month view
- if (false === (tribe_is_event_query() && tribe_is_month())) return $classes;
- $match = false;
- // Search for a match
- foreach ($classes as $index => $class)
- if ('sidebar' === $class) {
- $match = $index;
- break;
- }
- // If we found the .sidebar class then remove it
- if (false !== $match) unset($classes[$match]);
- return $classes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement