kasparsd / minit

A WordPress plugin to combine CSS and Javascript files.
GNU General Public License v2.0
286 stars 46 forks source link

wordpress child theme #1

Closed timoburmeister closed 11 years ago

timoburmeister commented 11 years ago

hi,

thanks for the good idea of a simple minifier for js and css.

But seems not to work with wordpress child themes.

I guess the error is that the necessary @import command to get the parent theme css is not correct translated. Seems like the path gets screwed.

thanks!

kasparsd commented 11 years ago

Hi Tim. It is better to use the wp_enqueue_style action with the get_template_directory_uri() function in your child theme, like so:

add_action( 'wp_enqueue_scripts', 'add_my_parent_styles' );

function add_my_parent_styles() {
    wp_enqueue_style( 'my-parent-css', get_template_directory_uri() . '/style.css' );
}

because there is no easy way to extract URL from the import() reliably as it can be relative, absolute and even remote style.

timoburmeister commented 11 years ago

ok thanks. will give it a try!

requisite2k commented 10 years ago

Same issue. Where do you place this code? child style.css, .htaccess or other?

bjornjohansen commented 10 years ago

requisite2k: In your child theme's functions.php