Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Making one CSS file from multiply CSS files

Home / Forums / Virtue Theme / Making one CSS file from multiply CSS files

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
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

  • The forum ‘Virtue Theme’ is closed to new topics and replies.