It is very best described in the WordPress Child theme codex page.
Basically to load child theme and parent theme stylesheet files, you have to just add following code in the functions.php file of your child theme.
function my_theme_enqueue_styles() {
$parent_style="parent-style";
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'styles',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style, 'enough_base' ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles', 99 );
You don’t need to enqueue other parent theme CSS files if you are not changing them.
Related Posts:
- Issues enqueueing parent & child theme stylesheets with revised Codex method
- Why is the Child Theme Stylesheet Not Loading?
- Give priority to child theme stylesheet
- Get parent theme version
- How to use parent theme’s enqueue methods
- How to maintain wp_enqueue_style dependencies set in parent theme style enqueuing
- Enqueue styles properly in a child theme and stylesheets location
- Style.css in child theme is loaded before Bootstrap
- How are updates to the style.css file in child theme recognized?
- How do I set up a child-theme without using @import
- Find a Parent Theme’s stylesheet $handle when it registers a stylesheet
- Dequeue only stylesheets but not inline style added using wp_add_inline_style
- Enqueue stylesheets if parent theme has more than one .css file
- ERROR MESSAGE: Missing index.php—Child Theme
- Priority loading file css in child theme
- Is my child theme working properly
- Child theme style repeated
- How to NOT call Font Awesome or font icons in WordPress
- @font-face broken in child theme
- Prevent a base themes css file from loading
- WordPress Child theme’s css not loading
- Confused about how to use wp_enqueue_style
- Child style loads before all parent styles
- How can I get this child theme stylesheet to properly load? Or if it is correct, why doesn’t my child theme appearance match the parent?
- Can only override parent theme styling with ‘!important’ in child style.css
- Why does using wp_register_style without wp_enqueue load and print CSS tags in the front-end?
- Remove Stylesheet by URL that has not been enqueued
- How to enqueue multiple style sheets into my child theme in wordpress (oceanwp)
- how to fix loading scripts in child theme?
- Why won’t my Custom CSS Load
- How to create my own style.css file in an wordpress child-theme
- Versioning @import of parent theme’s style.css
- How to add code to Header.php in a child theme?
- Why does my child theme CSS get called twice?
- Attributing a version number to a child theme’s main stylesheet
- how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?
- Hiding Parent Theme
- how to call files in child theme?
- Child theme showing a blank page
- Child theme preview missing
- Child Theme Performance
- How can you change default color scheme in a Twenty Fifteen child theme?
- I created a child theme and it doesn’t work for some of the css files
- Child Theme Not Overriding Parent Theme
- Proper way to make a tweaked theme into child-theme setting?
- Promoting child theme to stand alone
- Activating child theme returns “active theme is broken”
- How to override enqueued styles using a child theme
- Can’t override footer.php in child theme
- Recommended way to load / enqueue parent and child stylesheet to enable cache busting
- HTML head-tag get broken in my child theme
- iPhone Safari full size & PC versions different
- Where is wp-content/themes folder?
- Enqueue Child CSS to Load After Bootstrap CDN
- Child theme style.css versioning
- How to add child theme after using parent theme for long
- How to remove a script that was queued up in the footer in a parent theme
- Child them function.php ‘parent-style’: should I name this as parent theme name?
- Remote install won’t find Parent theme when intalling Child Theme, but local install does
- Different ways to load child theme css
- configuration for child theme
- How do add a the style-mobile css from the main theme to the child theme?
- Child Header.php Not Showing On Other Pages
- WOW.js animations work on one server, copied to new server, and stop working [closed]
- How to extend parent theme sections and settings to Options Tree
- GET parent theme throws 500 error in console, site works fine
- colorpicker WP 3.5 path to stylesheet when called from a child theme
- add function to thematic hooks [closed]
- All Titles and Menus changed to “CHILD THEME LOADED”
- Override post-formats in child theme
- child theme – moved files from twentyeleven theme to child them, now not working
- Which is the child theme and which is the parent theme?
- Storefront theme : Add Categoy to recent products section
- Is there any way to put the Google Tag manager Identification code into the child theme?
- Creating a child theme: How do I find the template name of the parent directory?
- Modifying a child theme
- In modifying a file in a subfolder in a child theme, do I need all the files in that sub folder in my child?
- design has been broken in WordPress child theme [closed]
- Is this the correct way to enqueue style sheets from parent theme and then from child theme in wordpress?
- CSS stopped working after line 150 [closed]
- Override file in parent theme
- Twenty ten or Twenty eleven as base for responsive child theme
- use child theme for mobile version
- How to replace function in child theme?
- Change child theme after updating parent theme
- Including code from other themes in child themes
- Child Theme not loading multiple stylesheets
- How to override styles from child theme if all the styles are in a folder?
- Alpha-store-child does not save changes
- why child theme style sheet in wordpress editor is blank?
- How to Create a Child Theme for a Site that Already has a lot of Customization?
- How to prevent funny characters on Home Page
- Change default header image in twenty fourteen child theme
- Why are my parent styles loading after my child styles?
- Functions.php in Child Theme – load JS
- creating a new child theme
- How to activate the child theme in WordPress?
- Selling a child-theme of twenty-thirteen is legal? [closed]
- What is __(arguments) in my functions.php
- How to override a theme template file with a child theme template file (of the same name)