hide elements of admin with css file


i use woocommerce and woocommerce Product Vendors (https://woocommerce.com/products/product-vendors/)
i want hide elements of admin with css file “my-admin.css”
I put css file “my-admin.css” at the root of my child theme wordpress
and use this code in functions.php.
This does not work?!?

function admin_css() {
    $admin_stylesheet = get_template_directory_uri() . 'my-admin.css';

    wp_enqueue_style($admin_handle, $admin_stylesheet);
add_action('admin_print_styles', 'admin_css', 11);

is this an obselete method?
when i use this other method in functions.php, it’s ok it works
add_action(‘admin_head’, ‘my_custom_fonts’);

function my_custom_fonts() {
  echo '<style>
    body, td, textarea, input, select {
      font-family: "Lucida Grande";
      font-size: 12px;

What do you think ?
thanks !!! 🙂

Calachuka 12 months 2021-10-11T12:52:30-05:00 0 Answers 0 views 0

Leave an answer