admin css wordpress add

Solutions on MaxInterview for admin css wordpress add by the best coders in the world

showing results for - "admin css wordpress add"
Mariana
03 Aug 2020
1    <?php
2      //from functions.php
3
4      //First solution : one file
5      //If you're using a child theme you could use:
6      // get_stylesheet_directory_uri() instead of get_template_directory_uri()
7      add_action( 'admin_enqueue_scripts', 'load_admin_style' );
8      function load_admin_style() {
9        wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
10//OR
11        wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
12       }
13
14      //Second solution : two or more files.
15      //If you're using a child theme you could use:
16      // get_stylesheet_directory_uri() instead of get_template_directory_uri()
17      add_action( 'admin_enqueue_scripts', 'load_admin_styles' );
18      function load_admin_styles() {
19        wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css', false, '1.0.0' );
20        wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css', false, '1.0.0' );
21      }  
22
23    ?>
24