Change Event Color

This topic contains 5 replies, has 3 voices, and was last updated by  oliowork 9 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7816

    I want the change the color of the event blocks on the event calendar (http://homeschool-open-source.com/events/) that are a medium blue.

    Where do I edit this?

    Thanks.

    AlphaSmith
    #7820

    Hi Alison,

    The colour is taken from the category. So you could assign all the categories the desired colour. Otherwise you can use the following code in a utility plug-in or your theme’s functions.php:

    function alison_assign_default_event_color( $color, $event_id ){
    
        if( empty( $color ) ){
            $color = '#84BE6A'; //A shade of green
        } 
    
        return $color;
    }
    add_filter( 'eventorganiser_event_color', 'alison_assign_default_event_color', 10, 2 );

    Please note that caching may mean that some changes do not appear immediately, but may take up to 24 hours to propgate through. You can clear the cache by “updating” an event.

    Stephen Harris
    #7823

    Thanks, Stephen. I’ll try that tomorrow.

    AlphaSmith
    #7915

    Following up on this, the code seemed pretty intense for what I wanted to do. I use the Thesis theme, so I was able to change the color just using this code in the Custom CSS file:

    .fc-event-inner {
        background: #ffc55f !important;
    }

    Similar fixes might work for others as well. 🙂

    AlphaSmith
    #7917

    That will also work 🙂

    Stephen Harris
    #19319

    Hello,

    Perhaps things have changed since 2013? I have the following in functions.php

    function eo_assign_default_event_color( $color, $event_id ){
        if( empty( $color ) ){
            $color = '#A34F16'; //rust
        } 
        return $color;
    }
    add_filter( 'eventorganiser_event_color', 'eo_assign_default_event_color', 10, 2 );
    

    But I still get the calendar output with inline style background-color: rgb(33, 117, 155).

    Is there a new way to handle default colors?

    oliowork
Viewing 6 posts - 1 through 6 (of 6 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.