简体   繁体   中英

Wordpress Child Theme CSS Import

I am creating a Wordpress JigoShop Online Store. Having bought their Jigotheme, I have created a child theme and activated it (with Jigotheme as parent template).

I tried to import the styles from the jigotheme using: @import url("../jigotheme/style.css");

(as per wordpress instructions)

The stylesheet is not pulling in - child theme works fine aside from this CSS import issue.

I know that no code can be above the @import code in the stylesheet - but would it not be working because the parent style.css also has @import code at the top of it? Are they conflicting perhaps?

Any help would be really appreciated!

您可以将另一个<link>元素添加到头部或使其入

The import statement should work. Double check the directory path and .css filename. If you're using Chrome, you can check the network tab to see if the parent style.css is actually being accessed.

Follow few steps:

  1. Replace bloginfo('template_directory'); ?> bloginfo('template_directory'); ?> with php bloginfo('stylesheet_directory'); ?> php bloginfo('stylesheet_directory'); ?> (Credit goes to @WouterB )

  2. Check if your parent theme using stylesheet which is located under sub-folder (eg. theme/css/style.css), in this case you have to place your child theme css under that folder.

  3. Remember to change path (may be you have to ../ before previous url)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM