Home › Forums › Calendar Products › Filter Bar › Overriding CSS
- This topic has 4 replies, 2 voices, and was last updated 9 years, 9 months ago by Barry.
-
AuthorPosts
-
July 29, 2014 at 7:53 am #532843Timothy LindsayParticipant
I notice that The Events Calendar and Events Calendar Pro plugins recommend your override their CSS styles by placing your own CSS file into a specific folder of your theme.
Is there a similar recommended method for overriding styles in the Filter Bar plugin? It isn’t documented in the standard CSS files as in the other two plugins.
July 29, 2014 at 8:05 am #532882Timothy LindsayParticipantOops, should have searched first: https://tri.be/support/forums/topic/adding-custom-styles-alongside-default-filter-bar-stylesheet/
So there’s no way to do a neat override like in the other plugins? I will add this as a feature request.
July 29, 2014 at 1:56 pm #534293BarryMemberPlease do feel free to make a feature request – we’d love to hear from you 🙂
An alternative approach though could be to add a stylesheet to your theme (tribe-events/filter-bar.css perhaps) and set it up with the following snippet – which you might add to your theme’s functions.php file:
add_action( 'wp_enqueue_scripts', 'add_filter_bar_stylesheet', 100 ); function add_filter_bar_stylesheet() { $custom_stylesheet_path = get_stylesheet_directory_uri() . '/tribe-events/filter-bar.css'; wp_enqueue_style( 'custom_filter_bar_stylesheet', $custom_stylesheet_path ); }
The slight advantage this would give you is that you would not need to dequeue the existing Filter Bar stylesheet or copy its rules across to your custom version (which would arguably be a more future-proof way of handling this).
I hope that helps and please do post a feature request 🙂
July 30, 2014 at 2:51 am #538144Timothy LindsayParticipantHi Barry, thanks agin for your great help! I had already gone down this route, but I didn’t yet know about the 100 argument in your snippet, which appears to make my custom stylesheet load *after* the Tribe default one, and in turn makes writing my custom CSS much easier.
July 30, 2014 at 9:56 am #540577BarryMemberYes exactly, it changes the priority and a higher value means it executes later. Glad it helped and good luck with the project 🙂
I’ll go ahead and close this topic but if we can help with anything else please feel free to create new ones as needed. As an aside, if you have a moment, we’d love to hear your thoughts on The Events Calendar over on our review page.
Thanks again!
-
AuthorPosts
- The topic ‘Overriding CSS’ is closed to new replies.