Viewing 12 replies - 1 through 12 (of 12 total)
  • All custom statuses give you new specific classes. You can style it very easy.

    My fancy status = .custom-status-my-fancy-status in calendar, or .status-my-fancy-status in post list view. Code for functions.php is:

    add_action('admin_footer','posts_status_color');
      function posts_status_color(){
    ?>
    <style>
     .status-draft {background: #FCE3F2 !important;}
     .status-pending {background: #87C5D6 !important;}
     .status-publish {/* no background keep wp alternating colors */}
     .status-future {background: #C6EBF5 !important;}
     .status-private {background:#F2D46F;}
     .status-completed-ticket th {border-left: 5px solid #6cc644;}
     .status-wait-for-response th {border-left: 5px solid #FBB117;}
    </style>
    <?php
    }

    Something like this, but easy to understand.
    I know topic is 5 months old, writing this to help someone else in the future.

    Thread Starter compukol

    (@compukol)

    Stagger Lee, please explain “My fancy status = .custom-status-my-fancy-status in calendar, or .status-my-fancy-status in post list view”.

    What else need to be done beside putting the code in functions.php?

    Thank you.

    If the name of your custom status is “”Completed ticket” then class for calendar part is .custom-status-completed-ticket. For post list is .status-completed-ticket. It names automatically.

    This way you can target and style calendar and post lists. I am testing this for projects, tasks, etc…so coloring is important part for me.

    One word more, this is only for backend.

    If you have much styling better to make new css file, put it in theme folder and use:

    function my_admin_theme_style() {
        wp_enqueue_style('my-admin-style', get_template_directory_uri() . '/admin-override.css');
    }
    add_action('admin_enqueue_scripts', 'my_admin_theme_style');
    Thread Starter compukol

    (@compukol)

    Stagger, I still don’t understand you. Your instructions are too technical can you please simplify them.

    My custom statuses are: Pitch, Assigned, In Progress, Draft, Pending Review, Waiting for Edit, and Publish

    Thank you,

    Thread Starter compukol

    (@compukol)

    Adding your code in functions.php seem to colorize the post in list view but not in calendar view.

    You need to slightly change my code.

    add_action('admin_footer','posts_status_color');
      function posts_status_color(){
    ?>
    <style>
    /* Post list part */
     .status-draft {background: #FCE3F2 !important;}
     .status-pending {background: #87C5D6 !important;}
     .status-publish {/* no background keep wp alternating colors */}
     .status-future {background: #C6EBF5 !important;}
     .status-private {background:#F2D46F;}
     .status-completed-ticket th {border-left: 5px solid #6cc644;}
     .status-wait-for-response th {border-left: 5px solid #FBB117;}
    /* Calendar part */
    custom-status-pitch {background:  #FBB117;}
    custom-status-assigned {background:  #FBB117;}
    custom-status-in-progress {background:  #FBB117;}
    custom-status-draft {background:  #FBB117;}
    custom-status-wpending-review {background:  #FBB117;}
    custom-status-waiting-for-edit {background:  #FBB117;}
    custom-status-publish {background:  #FBB117;}
    </style>
    <?php
    }

    Change background colors as you need it. And if you have difficult to read text add color:#something.

    You can delete my own lines and classes. But better to comment them, to have it later if you will need them.

    For instance:

    /* .status-completed-ticket th {border-left: 5px solid #6cc644;} */

    Thread Starter compukol

    (@compukol)

    Still no colors in calendar view.

    O, sorry man, forgot it. Put a period “.” before all “custom”:
    .custom-status-publish

    Thread Starter compukol

    (@compukol)

    Perfect! That is exactly what I was looking for.

    Thank you very much.

    You are welcome.
    Click “Resolved” option.

    Thread Starter compukol

    (@compukol)

    Resolved

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Feature request: Colorized Custom Statuses’ is closed to new replies.