How can I (for the long term) style the classic editor's TEXTAREA?

admin2025-06-04  2

I would like to apply minor styles main TEXTAREA forthe classic editor, for editing source directly. When I inspected the source, the top source listed was load_style.php and editor.min.css.

I was able to easily enough get past a smoke text for changes in ?editor.css? and editor.min.css, but editor.min.css has a warning that it's an autogenerated file, and not terribly long after, my changes were undone.

What file(s) can I change, or what else can / should I do, to style textarea.wp-editor-area#content?

I would like to apply minor styles main TEXTAREA forthe classic editor, for editing source directly. When I inspected the source, the top source listed was load_style.php and editor.min.css.

I was able to easily enough get past a smoke text for changes in ?editor.css? and editor.min.css, but editor.min.css has a warning that it's an autogenerated file, and not terribly long after, my changes were undone.

What file(s) can I change, or what else can / should I do, to style textarea.wp-editor-area#content?

Share Improve this question asked Jan 3, 2019 at 0:20 Christos HaywardChristos Hayward 639 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I think I am following your question.

You can enqueue a stylesheet only for the admin area and then add your styles to that. The following code will enqueue a stylesheet in a "css" folder in the root of your theme.

function my_admin_styles(){
    wp_enqueue_style(
        'admin_css', 
        get_stylesheet_directory_uri() . '/css/admin-styles.css', array(), filemtime( get_stylesheet_directory() . '/css/admin-styles.css') 
    );
}

add_action('admin_enqueue_scripts', 'my_admin_styles');

All you need to do is create a css directory in your themes root, add a file called admin-styles.css and add your styles to that.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749043753a315876.html

最新回复(0)