November 12, 2015 at 8:00 pm
Hello Ben,
I found on net this code to link CSS files to one, but I want to ask you if that option is correct?
I just want to speed up my homepage, and in speed and SEO test was found that I have too many CSS files…..I made one separate CSS in my child theme, but that CSS is empty because I insert all my custom code in Theme Options / Advanced Settings….
I just want to ask you is next code is correct?….And where I can find path names of all my CSS files?….
add_action(‘init’, ‘my_theme_register_styles’);
function my_theme_register_styles() {
wp_register_style(‘my_theme_style1’, get_stylesheet_directory_uri() . ‘/style1.css’, array(), ‘1.0’, ‘all’);
wp_register_style(‘my_theme_style2’, get_stylesheet_directory_uri() . ‘/style2.css’, array(‘my_theme_style1’), ‘1.0’, ‘all’);
wp_register_style(‘my_theme_style3’, get_stylesheet_directory_uri() . ‘/style3.css’, array(‘my_theme_style1’, ‘my_theme_style2’), ‘1.0’, ‘all’);
global $wp_styles;
$wp_styles->add_data( ‘my_theme_style3’, ‘conditional’, ‘lte IE 7’ );
}
My homepage: http://www.greensmeans.com
Thank you
Many Greetings
Satoko T