css - Style classic editor buttons

I'm trying to style the buttons in the classic editor of wordpress, in particular to change color of the text insid

I'm trying to style the buttons in the classic editor of wordpress, in particular to change color of the text inside or change the font-wright property.

Using the browser inspector tool I looked for the class name of the buttons, and then it was easy to change color, see image

So then I tried to make the change permanent by adding this css code to style.css file

.qt_content_center {
    color: red;
}

I refreshed the page and I verified that the edited file was loaded, but the button color was not changed.

I also tried

#qt_content_center {
    color: red;
}

but did not work.

This is how the buttons appear in the inspector tool

<div id="ed_toolbar" class="quicktags-toolbar" style="position: absolute; top: 87px; width: 702px;">
    <input type="button" id="qt_content_collpasible button" class="ed_button button button-small" value="BTN">
    <input type="button" id="qt_content_content" class="ed_button button button-small" value="CON">
    <input type="button" id="qt_content_center" class="ed_button button button-small" value="center">
<div>

Maybe to style the buttons the code have to be placed in the functions.php file, but there css code doesn’t work, does it?

I'm trying to style the buttons in the classic editor of wordpress, in particular to change color of the text inside or change the font-wright property.

Using the browser inspector tool I looked for the class name of the buttons, and then it was easy to change color, see image

So then I tried to make the change permanent by adding this css code to style.css file

.qt_content_center {
    color: red;
}

I refreshed the page and I verified that the edited file was loaded, but the button color was not changed.

I also tried

#qt_content_center {
    color: red;
}

but did not work.

This is how the buttons appear in the inspector tool

<div id="ed_toolbar" class="quicktags-toolbar" style="position: absolute; top: 87px; width: 702px;">
    <input type="button" id="qt_content_collpasible button" class="ed_button button button-small" value="BTN">
    <input type="button" id="qt_content_content" class="ed_button button button-small" value="CON">
    <input type="button" id="qt_content_center" class="ed_button button button-small" value="center">
<div>

Maybe to style the buttons the code have to be placed in the functions.php file, but there css code doesn’t work, does it?

Share Improve this question asked Sep 19, 2019 at 20:41 sound wavesound wave 2151 gold badge3 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

You can add CSS to the admin area of WordPress using the [admin_head][1] hook

add_action('admin_head', 'my_custom_admin_styles');

function my_custom_admin_styles() {
  echo '<style>
    #qt_content_center {
         color: red;
    }
  </style>';
}

Note: Alternatively, you could add a stylesheet using the same function.

Edit: Adding custom stylesheet to WP Admin.

add_action( 'admin_enqueue_scripts', 'load_admin_styles' );

function load_admin_styles() {
    wp_enqueue_style( 'admin-styles', get_template_directory_uri() . '/admin-styles.css', false, '1.0.0' );
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745142535a4613495.html

相关推荐

  • css - Style classic editor buttons

    I'm trying to style the buttons in the classic editor of wordpress, in particular to change color of the text insid

    5小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信