but it changes the background not the font color.
Change:
.status-future { background: #E9F2D3 !important;}
to…
.status-future {color: #E9F2D3 !important;}
.status-future { color: #E9F2D3 !important;}
Untested but this is pure CSS π
thanks, I had already tried it that way but, I don’t know why, I didn’t work.
I have just tried it again.
.status-future { color: #E9F2D3 !important;}
and it seems not to be working.
-
This reply was modified 7 months, 3 weeks ago by
anafasia.
Where exactly do you insert the code?
functions.php, in its bottom.
with background works immediately once placed.
.status-future { background: #E9F2D3 !important;}
You cannot enter CSS code into a PHP file without something else. What exactly is the code you are using?
add_action('admin_footer','posts_status_color');
function posts_status_color(){
?>
<style>
.status-draft { color: #ffffe0 !important;}
.status-future { color: #E9F2D3 !important;}
.status-publish {/* no background keep WordPress colors */}
.status-pending { color: #D3E4ED !important;}
.status-private { color: #FFECE6 !important;}
.status-sticky { color: #F9F9F9 !important;}
.post-password-required { color: #F7FCFE !important;}
</style>
<?php
}
Okay, that’s syntactically correct, at least. Now I’m still unclear about how you display the post status in the tables. Which plugin do you use for that?
no plugin. I place that code at the end of the functions.php in my themes wordpress directory. as I said, if I do the same with background instead of color it shows the background colored.
no plugin. I place that code at the end of the functions.php in my themes wordpress directory
Below is what the default WordPress Posts listing page should look like. You have additional columns, including this “Post Status” that you’re trying to colorize.
The code you provided only adds CSS style and cannot, in any way, shape, or form, be responsible for displaying any of the extra columns you have in your Posts table.
So, once again, how are you displaying the post status column in the table?

I have no post status column. this was created by the plugin -simply changing Date to Post Status, I guess-. what I see now -without the plugin, is the same as you- a column named Date where I would like to change the color of Last Modified, Scheduled…
Ah, now I understand exactly what you mean. Coloring it would be possible with this:
add_action('admin_footer','posts_status_color');
function posts_status_color(){
?>
<style>
.status-draft .date { color: #ffffe0 !important;}
.status-future .date { color: #E9F2D3 !important;}
.status-publish .date {/* no background keep WordPress colors */}
.status-pending .date { color: #D3E4ED !important;}
.status-private .date { color: #FFECE6 !important;}
.status-sticky .date { color: #F9F9F9 !important;}
.post-password-required .date { color: #F7FCFE !important;}
</style>
<?php
}
thanks a lot to both, you are totally right. now it works. you don’t see a thing with those colors, but this is easy to change. thanks again.
should I marked it as solved?
Note that the plugin referenced in the initial post of this thread seems to be https://ww.wp.xz.cn/plugins/wordpress-scheduled-time/ which is currently temporarily closed. (The reason the plugin was closed is currently not public.)
that plugin was not updated for a long time. I always received warnings from WordFence for that reason -not being updated made it not reliable-. this is why I had to remove it, in the end. and this is also probably the reason why it has been removed.
-
This reply was modified 7 months, 3 weeks ago by
anafasia.