$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>How can I (for the long term) style the classic editor's TEXTAREA?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin10PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far