0

I just made my first child theme and it is working fine. But there are other css that needs to be changed which is loading from the parent and its dir structure is themes/css/layout.css So I need to make that css load through child

I tired to do like this:

/*
 Theme Name:   Artificer
 Theme URI:    http://example.com/twenty-thirteen-child/
 Description:  artificer Child Theme
 Author:       Rabin Shrestha
 Author URI:   http://example.com
 Template:     artificer
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fourteen-child
*/


/*
@import url("../artificer/css/layout.css");
*/

/* =Theme customization starts here
-------------------------------------------------------------- */

and put the other css below and also put that css directory and layout.css inside the child theme but nothing happned. please help me

5
  • Why is everything commented out? Commented Aug 21, 2014 at 16:46
  • @AndreYonadam coz that is the way we should initialize the header as said here -> elegantthemes.com/blog/resources/wordpress-child-theme-tutorial with title getting started Commented Aug 21, 2014 at 16:51
  • Yeah but your commenting out your import css and maybe the theme customization which I don't know because you don't have any css below. Commented Aug 21, 2014 at 16:52
  • I do have it is more than 3000 lines... Should I post it??? Commented Aug 21, 2014 at 16:57
  • 1
    remove the comment from the import Commented Aug 21, 2014 at 17:01

1 Answer 1

1

I realize your attempt to comment out the parent theme's css is intentional (unlike commenters)...and you have also tried to implement your own css.

Your issue is that most likely artificer (i'm not entirely familiar with that theme) most likely enqueues (or references) their other CSS files directly...and not via css imports. This is why your attempts at preventing that theme from loading their css files (and not your own) are not working.

Two possible solutions.

  1. If the artificier author created conditional checks (is function defined) around the methods that enqueue their css files...you can use define your own function with same name to enqueue your own css files. Not too many theme authors do this though.
  2. The not so elegant way...is to just include a CSS override file that gets called after artificier css files that applies the tweaks you want done.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.