Hi danjde,
Using @import is not as bad as it is written. I use it all the time without any trouble.
Anyway,
As you described your process you added just enqueue script action and did not included enqueued enqueue style action
read again this
I think you missed this code to add to your child’s function.php file
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
Hope Im helpful.
Cheers
@tahoerock
Thread Starter
danjde
(@danjde)
Hi Tahoe and thanks very much for your help!!
I’ve put as you suggest also the last piece of code as below:
?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
?>
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
<?php
But it has no make changes:
only if I edit the originary style.css can obtain any result.
Could be an issue specific of my theme? I’m using a “non standard” (aka commercial) wordpress template.
Or I should customize this code?
Many thanks again!
-
This reply was modified 9 years, 5 months ago by
danjde.
If you’re using a commercial theme, there’s a chance that it loads its stylesheets in a goofy way, and since no one here has access to your theme to check, you’re probably better off asking your theme’s vendors for support. After all, that’s part of what you paid for.
Hi Dandje,
YES, I have to aggre with Stephen.
I was gouing to suggest same. We cannot check it here.
It is paid and they should provide apropriate support.
Wishing you the best
Cheers
@tahoerock
Thread Starter
danjde
(@danjde)
Yes @tahoerock and @stephencottontail you are right, thanks for helping me to understand that the problem depends on the template.
thanks again!