How to load a CSS file into WordPress admin area using Child Theme? [closed]

You need to use admin_enqueue_scripts hook to load CSS in admin area. This goes in your themes functions.php. Assumed that your file is at child_theme_path/css/admin-css.css function wpse239532_load_admin_style() { wp_enqueue_style( ‘admin_css’, get_stylesheet_directory_uri() . ‘/css/admin-css.css’, false, ‘1.0.0’ ); } add_action( ‘admin_enqueue_scripts’, ‘wpse239532_load_admin_style’ );

Getting rid of unused css directives [closed]

The guys behind this project I trust a lot. https://unused-css.com/ Also I used this long time ago: https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/ However, you need to be careful, because you must not remove some CSS that will be used in the future, or in case some feature is enabled later.

How to dequeue / deregister parent theme style

It is pretty simple: function remove_nada_theme_font_style() { remove_action( ‘wp_enqueue_scripts’, ‘nada_theme_styles’ ); } add_action( ‘after_setup_theme’, ‘remove_nada_theme_font_style’ ); Since the child theme is loaded before the parent theme, you can’t simply remove the action. because the add_action calls in the parent theme will simply overwrite your requests. You have to wrap it into the after_setup_theme hook. This … Read more

Setting up the child theme so as to enable right-to-left WordPress?

You also need to include the RTL.css file which is in the theme too: add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ ); function my_theme_enqueue_styles() { wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘rtl-style’, get_template_directory_uri() . ‘/rtl.css’ ); } To use the rtl.css from your theme directory change the code to: add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ ); function my_theme_enqueue_styles() { wp_enqueue_style( ‘parent-style’, … Read more

Hwo to turn off “get_parent_theme_file_path” in child-theme?

If you look at get_parent_theme_file_path() it returns apply_filters( ‘parent_theme_file_path’, $path, $file ); You need to add a filter here to override the location to something in your child theme, like so. add_filter(‘parent_theme_file_path’, function($path, $file) { if ($file !== ‘/inc/icon-functions.php’) { return $path; } $path = get_stylesheet_directory() . “https://wordpress.stackexchange.com/” . $file; return $path; }, 10, 2); … Read more