- This topic has 45 replies, 3 voices, and was last updated 7 years, 5 months ago by
Tom.
-
AuthorPosts
-
February 20, 2018 at 8:18 am #501234
Leo
StaffCustomer SupportI’m not sure what you mean?
If all of those 200 pages have the same category then we can just select it all using CSS as well?
Can you link me to a couple examples where you want to change?
February 20, 2018 at 4:34 pm #501510elsa
Hi Leo,
if there is simple code to select all of them, I’d be glad to use it. These are the pages.All product under category kids for example https://spruceupspace.com/product/wooden-bunny-plate-4-models/
All category archives under kids consists of subcategories for example https://spruceupspace.com/product-category/kids/storage/
Particular Tags archive such as swan, bat, unicor, etc
Pages: Kids -> https://spruceupspace.com/kids/welcome
Blog post under category kidsFebruary 20, 2018 at 10:42 pm #501641Leo
StaffCustomer SupportI can’t get your site to load.
Can you double check?
Thanks!
February 20, 2018 at 11:11 pm #501653elsa
It’s active. I don’t know why you couldn’t access it.
February 21, 2018 at 9:38 am #502162Tom
Lead DeveloperLead DeveloperIf you want to enqueue that file under those conditions, you would do this:
add_action( 'wp_enqueue_scripts', 'mytheme_styles_scripts', 200 ); function mytheme_styles_scripts() { if ( is_page( 'Kids' ) || is_product_category( 'Kids' ) || has_term ('kids', 'product_cat')) { wp_enqueue_style( 'kids', trailingslashit( get_stylesheet_directory_uri() ) . 'kids.css' ); } }
This assumes you have a kids.css file in the root directory of your child theme.
February 22, 2018 at 12:06 am #502546elsa
Hi Tom,
I don’t know what’s going on but it doesn’t work. I’ve ensured that kids.css is located in the root directory of child theme along with style.css.I’ve also ensured that the css code is working. When I paste the code on simple CSS metabox on product page, the code is working.
How to identify where the problem is? Do I have to write css file on specific application?
February 22, 2018 at 11:32 am #503094Tom
Lead DeveloperLead DeveloperIt looks like it’s working for me.
The kids.css is loading on this page: https://spruceupspace.com/kids/welcome
February 22, 2018 at 5:14 pm #503283elsa
Hi Tom, for that page, I inserted the CSS on simple CSS Metabox. Please open this from mobile phone.
February 22, 2018 at 8:21 pm #503368Tom
Lead DeveloperLead DeveloperYou can see the kids.css file loading here: https://www.screencast.com/t/mXFRC5bdFhw
It’s just being overwritten by the CSS you’ve added into Simple CSS.
February 22, 2018 at 9:07 pm #503381elsa
Hi Tom,
So glad to know that actually it’s loading. When I delete the code from CSS Metabox, the header color went black, unlike what I set on kids.css, supposed to be green. I think it’s still refer to mobile.min.css?ver=2.0.2 instead of kids.css for several part. What I should do then?February 23, 2018 at 9:58 am #503912Tom
Lead DeveloperLead DeveloperI just edited this code: https://generatepress.com/forums/topic/mobile-menu-and-mobile-header-color-for-different-page/page/2/#post-502162
Can you try it instead?
February 23, 2018 at 4:15 pm #504142elsa
It’s working, so awesome! Thanks Tom!
February 23, 2018 at 4:21 pm #504151elsa
Hi Tom, there is something else that has not been working yet. For “add to cart” button, add to cart notification, and “Description”; the color still refer to the initial setting on customizer that overwrite kids.css. How to resolve this? For example page:
https://spruceupspace.com/product/banana-bean-bag-chair/
Thanks!
February 23, 2018 at 9:25 pm #504262Tom
Lead DeveloperLead DeveloperI just made one more edit which should fix that: https://generatepress.com/forums/topic/mobile-menu-and-mobile-header-color-for-different-page/page/2/#post-502162
February 24, 2018 at 2:27 am #504370elsa
So cool, it’s working! Thanks so much.
-
AuthorPosts
- You must be logged in to reply to this topic.