Twentytwelve child css changes not working
-
Hi everyone. Apologies first, I’m new at this so sorry if I’ve made a really dumb mistake. I’d be delighted if I have because then it’s easy to fix.
I’m trying to use a child theme of twentytwelve to make some small tweaks.
I’ve followed the instructions in the codex step by step, and have made a child theme. I know it’s there and working becuase when I take out the @import url line, twentytwelve layout disappears.
But, when I then put in the code from the codex to change the site title to green (as a test) .site-title a { etc etc nothing happens.
I spent about four hours yesterday googling for solutions to this. Most of what i found circled round making a header.php file in the child directory and then replacing “echo get_template_directory_uri()” with “?php echo get_stylesheet_directory_uri()”
(for example here: https://stackoverflow.com/questions/4462258/wordpress-child-theme-css-not-reflecting-on-site )
So I made a header.php in two ways, by cutting and pasting the header code from a support thread, and by copying the header file from twentytwelve into the child theme
I know the header.php is working because I can change the order of the code in the file and successfully change the layout to put the navigation menu below the header image (which is one of the tweaks I want to make).
So I then search for get_template_directory_uri() in the header.php file, replace it with get_stylesheet_directory_uri() and…
css changes still don’t work.
What I also noticed was that the code surrounding get_template_directory_uri() looks different in each of the headers or forum threads I’ve looked at.
The only real advance on that that I’ve found is in this thread,
https://www.ads-software.com/support/topic/cant-get-twentytwelve-child-theme-to-work?replies=27which at the bottom says:
“the right way is to work with the functions.php file:
wp_ dequeue_ style( ‘twentytwelve-style’ );
wp_ deregister_ style( ‘twentytwelve-style’ );
wp_ register_ style( ‘twentytwelve_style’, get_template_directory_uri() . ‘/style.css’ );
wp_ enqueue_ style( ‘twentytwelve_style’ );must be put where it should. codex :)”
If I put a functions.php file in my child theme, but what do I cut and paste into it?
Only other thing to add is that I’m trying to make the same tweaks on two twentytwelve installations on two different servers from two different hosting companies.
Many thanks in advance
Andrew
- The topic ‘Twentytwelve child css changes not working’ is closed to new replies.