-
AuthorPosts
-
March 19th, 2017 at 02:14 #43354
Hi There,
I am trying to create a child theme from Parabola. I followed the instructions on the WordPress Codex page. They say not to use @import in your child’s stylesheet, rather they say to wp_enqueue_styles in your child’s functions.php. I am doing this, but when I preview the child theme, the styles aren’t loading correctly. The colors are there, but the fonts and the slider do not display correctly.
I am not making any changes to the CSS, I want a child theme because I have some custom templates and PHP. Currently, I have to re-upload them every time the theme gets updated, so I am hoping to use a child theme, but since it seems that only half the stylesheet gets loaded, I’m not sure what to do.
Thanks!
Website: www.sarahsmathings.com
March 19th, 2017 at 16:11 #43380ZedCryout Creations mastermindWhat code do you have in your child theme’s functions.php so far?
If you like our creations, help us share by rating them on WordPress.org.
Please check the available documentation and search the forums before starting a topic.March 20th, 2017 at 04:00 #43394Thanks for replying. I currently have this:
<?php
function my_theme_enqueue_styles() {$parent_style = ‘parabola-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’ );
?>March 23rd, 2017 at 02:33 #43452Hi there, have you been able to identify what I may be doing wrong? I noticed that the parabola style.css has a line importing the fontfaces.css file. Since my child style is not registering the fonts, could it be that I need to enqueue this stylesheet as well?
March 25th, 2017 at 10:47 #43490ZedCryout Creations mastermindYou don’t need to enqueue the child theme’s style, as WordPress does that, and I don’t think the wp_enqueue_script hooks the right place to do this (that normally gets outputted in the footer).
Try this code instead:
// enqueue parent theme styling function child_parent_styling(){ wp_enqueue_style( 'parabola-parent', get_template_directory_uri() . '/style.css' ); // main style.css } add_action('wp_head','child_parent_styling', 4);
If you like our creations, help us share by rating them on WordPress.org.
Please check the available documentation and search the forums before starting a topic.March 27th, 2017 at 03:47 #43519That got it. Thanks so much!
-
AuthorPosts
The topic ‘How to Fully Include Parent Styles in Child Theme’ is closed to new replies.