First…
What is the name of your parent theme? (the name on its folder – all in small case letters)
What is the name of your child theme? (the name on its folder – all in small case letters)
parent theme is ‘matheson’
child theme is ‘matheson-child’
Remove @import "(../matheson/style.css)";
from your child theme’s css (style.css).
Is there any other code (besides <?php
) in the child theme’s functions.php
file?
If yes, post back here before doing anything.
If not, proceed…
If there is no other code in the functions.php
file, paste the code below, exactly as it is, into your child theme’s functions.php
file.
No closing tag – ?>
– and no space underneath the last line of code.
If there is a <?php
already at the top of the functions.php
file – delete it. There only needs to be one <?php
…
<?php
function mathesonchild_enqueue_styles() {
$parent_style = 'matheson';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'matheson-child',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style )
);
}
add_action( 'wp_enqueue_scripts', 'mathesonchild_enqueue_styles' );
Let me know if it works.
Thanks for your help. I did exactly what you said. It didn’t seem to make any difference.
There is no space underneath the code?
Clear your browser’s cache and refresh your browser.
sure thing. It didn’t seem to make a difference. :/
no space underneath the .php code. I deleted the old code and pasted exactly what you typed.
The Child Theme is loading twice…
<link rel='stylesheet' id='matheson-css' href='http://andysells.net/wp-content/themes/matheson/style.css?ver=4.4.1' type='text/css' media='all' />
<link rel='stylesheet' id='matheson-child-css' href='http://andysells.net/wp-content/themes/matheson-child/style.css?ver=4.4.1' type='text/css' media='all' />
<link rel='stylesheet' id='theme_stylesheet-css' href='http://andysells.net/wp-content/themes/matheson-child/style.css?ver=4.4.1' type='text/css' media='all' />
…do you have some plugin for creating a child theme running?
This one here…
<link rel='stylesheet' id='theme_stylesheet-css' href='http://andysells.net/wp-content/themes/matheson-child/style.css?ver=4.4.1' type='text/css' media='all' />
…is not the standard loading function.
Do you mean a plugin in WP? or my browser? No, not to my knowledge. I installed Firebug yesterday. I haven’t installed any plugins in WP at all.
Something somewhere on your site is loading an exact copy of your child theme. It is either part of the theme doing it or a plugin, because of the way this is written – “theme_stylesheet-css” instead of “matheson-child-css” – but you say you have no plugins running.
This is the links to my parent and child css on my development site…
<link rel='stylesheet' id='neotechnomadbase-css' href='http://neotechnomadbase.neotechnomad.ca/wp-content/themes/neotechnomadbase/style.css?ver=4.4.1' type='text/css' media='all' />
<link rel='stylesheet' id='neotechnomadchild-css' href='http://neotechnomadbase.neotechnomad.ca/wp-content/themes/neotechnomadchild/style.css?ver=4.4.1' type='text/css' media='all' />
…this is how it is supposed to look like.
Firebug wouldn’t do anything.
hmm.. it looks like Jetpack was activated. Should I de-activate it? Should I re-install the child theme and start from the scratch with the code you provided for my child’s functions.php?
No, just deactivate Jet-Pack and any other plugin that may be running and then see if everything is working.
Let me know when the plugins are deactivated and I will check the source code.
I deactivated it. That was the only thing running. Thanks.