Proper Way To Load Wordpress Parent Stylesheet

Posted by Weston Ganger

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');

Article Topic:Software Development - Wordpress

Date:April 30, 2014

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected