Overriding CSS

Home Forums Calendar Products Filter Bar Overriding CSS

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #532843
    Timothy Lindsay
    Participant

    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.

    #532882
    Timothy Lindsay
    Participant

    Oops, 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.

    #534293
    Barry
    Member

    Please 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 🙂

    #538144
    Timothy Lindsay
    Participant

    Hi 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.

    #540577
    Barry
    Member

    Yes 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!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Overriding CSS’ is closed to new replies.