Tạo và đưa Css vào WordPress Admin - Define and apply custom css on Wordpress Admin css

Post Reply
tthlan
Quản trị viên
Posts: 68
Joined: Tue Aug 23, 2016 8:13 am

Tạo và đưa Css vào WordPress Admin - Define and apply custom css on Wordpress Admin css

Post by tthlan » Wed Jan 11, 2017 3:51 am

1) Define 'admin.css' file on 'DocumentRoot/wp-content/themes/yourtheme/css' folder

Code: Select all

/** Update CSS within in Admin **/
@media only screen and (max-width: 1172px)
{
    input.data[type=text], textarea.data {
        width: 100%;
    }
}
@media only screen and (max-width: 782px) {
    input.data[type=text], textarea.data {
        width: 100%;
    }
}
2) Apply that css on 'DocumentRoot/wp-content/themes/yourtheme/function.php'

Code: Select all

/* Update CSS within in Admin */
function admin_theme_style() {
    //die(get_template_directory_uri().'/css/admin.css')
    wp_enqueue_style('custom-admin-style', get_template_directory_uri().'/css/admin.css');
}
add_action('admin_enqueue_scripts', 'admin_theme_style');
3) Check and see that css effect on WP Admin. Success!
Without change on original css files such as DocumentRoot/wp-admin/css/wp-admin.min.css , wp-admin-rtl.min.css - as will more css files which are using on WP Admin depend you see.

Post Reply