Wordpress

Proper Way To Load Wordpress Parent Stylesheet

Posted by Weston Ganger on April 30, 2014

You shouldnt be using the @import directive in your stylesheet

It slows things down and can cause some issues for media queries etc.

Instead you should add it to your functions.php file of your child theme:

function yourFunctionName(){
wp_enqueue_style('themeNameParentStyle', get_template_directory_uri*() . '/style.css', array(), 'all');
}
add_action('wp_enqueue_scripts','yourFunctionName');

Posted in Wordpress and Tagged with wordpress 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts