Answers for "add css file in admin wordpress"

1

admin css wordpress add

<?php
      //from functions.php

      //First solution : one file
      //If you're using a child theme you could use:
      // get_stylesheet_directory_uri() instead of get_template_directory_uri()
      add_action( 'admin_enqueue_scripts', 'load_admin_style' );
      function load_admin_style() {
        wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
//OR
        wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
       }

      //Second solution : two or more files.
      //If you're using a child theme you could use:
      // get_stylesheet_directory_uri() instead of get_template_directory_uri()
      add_action( 'admin_enqueue_scripts', 'load_admin_styles' );
      function load_admin_styles() {
        wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css', false, '1.0.0' );
        wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css', false, '1.0.0' );
      }  

    ?>
Posted by: Guest on April-10-2021
2

how to add css file in wordpress

wp_enqueue_style( 'style', get_stylesheet_uri() );
Posted by: Guest on May-28-2020

Code answers related to "add css file in admin wordpress"

Browse Popular Code Answers by Language