• Hi There !

    I happilly use Edit Flow for a while now, and I would like to optimize the look of the calendar.

    Is there a way to give a color for each post regarding its status ?
    For example : every draft in yellow, every scheduled post in green etc.
    Is it possible for the custom statuses I created with Edit Flow ?

    Thank you for your help !

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jennif2101

    (@jennif2101)

    Just to let you know, I used this snippet for the post list of wordpress, into function.php.

    I’d like to do something like that for the calendar, but I don’t know how and where…

    
    function color_css_post_status() {
    ?>
    <style>
    .status-brouillon{background: #FFFF99 !important;}
    .status-future{background: #b1edd4 !important;}
    .status-mis-en-forme{background: #87C5D6 !important;}
    .status-private{background: #FFCC99 !important;}
    .status-pret-relecture{background: #f7a7a3 !important;}
    .status-orthog-ok{background: #f9cba4 !important;}
    .status-valide-cheffes{background: #e9d1fc !important;}
    .status-1erjet-ephemeride{background: #76dee0 !important;}	
    .status-publish{}
    </style>
    <?php
    }
    
    add_action('admin_print_styles-edit.php','color_css_post_status');

    Thanks again

    Hi Jen,

    You’re on the right track – adding styles targeted to the wp-admin…..

    Follow the two steps on this tutorial, only you’ll want to target the table#ef-calendar-view and the status within that selector ID:

    https://davidwalsh.name/add-custom-css-wordpress-admin

    Good luck!

    Thread Starter jennif2101

    (@jennif2101)

    Thanks TrishaM,

    My problem is a bit complicated.
    I would like to have a different color for each costum status (created thanks to Edit Flow) and appearing in the background of Edit Flow Calendar…

    So I can find in a glance if my posts are scheduled, pending, drafts etc.

    I have no idea what function could create that, and where.

    Yes, but it’s not as complicated as you think……and you are on the right track.

    Step one: create a style declaration for each of the custom statuses created by EF. This style declaration should be in a separate stylesheet for any custom styles you want for the *admin* (back end) NOT the front end – so don’t put it in your Theme’s normal stylesheet. Create a new one, it can be in your Theme folder along with the normal stylesheet, but keep in mind if you switch themes you’ll need to copy or move it to your new theme’s folder.

    Step two: in your functions.php you need a statement to add this new stylesheet to the admin’s init so you’ll need to add something like this example:

    // Update CSS within in Admin
    function admin_style() {
      wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css');// in this example, 'admin.css' is the name of the stylesheet that contains your desired custom admin styles.
    }
    add_action('admin_enqueue_scripts', 'admin_style');// this tells WP to load your new stylesheet when it enqueues the admin scripts
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom status color in calendar’ is closed to new replies.