Take a look at How to create a Child Theme and you’ll see that:
the previous method to enqueue the parent stylesheet was to import the parent theme stylesheet using @import: this is no longer best practice. The correct method of enqueuing the parent theme stylesheet is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme’s functions.php.
Here’s the example provided:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
Related Posts:
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- Add colors to existing color palette without replacing it
- add_image_size is scaling, even though crop is set to true
- How do I get a parent theme modification from a child theme?
- CSS in child theme not overriding the parent theme [closed]
- Optimal solution to develop a wordpress theme?
- Should I update my _s theme?
- Create a theme by combining a parent and a child theme
- Override Constants in Child theme
- how can I remove the sidebar from my wp homepage [closed]
- Does any theme support child theme?
- Am I supposed to create a child theme for every theme I use?
- How to remove a file included in parent theme with locate_template() via child theme?
- Cannot figure out how to overwrite files in child theme
- How to add theme support?
- Override template file i subfolders
- Include Parent functions.php in Child Theme functions.php
- Why is it needed to enqueue parent stylesheet in child theme?
- Child Theme’s style.css not loading in mobile browser
- Renaming a theme so it aids SEO and the theme used is hidden
- Overrite parent functions using child functions
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- Create a child theme from multiple themes
- Starting point for custom Themes [closed]
- Simple child theme modification but links are broken
- Why still output /wp-content/themes/twentynineteen?
- Alignment Problem [closed]
- What $handle does WordPress use for a theme’s implicit style.css?
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- LESS not working in WordPress [closed]
- Remove h1 from 2015 theme
- Converting a theme to a child theme in a network
- How to modify theme content in Thematic?
- Why front-page.php doesn’t show content of file instead shows loop
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How can I access variables from theme in child theme? [closed]
- How to display home page last modified date in anywhere of wordpress theme?
- What is an alternative to not using child theme to customize a WordPress theme?
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- Child theme menu not appearing in Twenty Seventeen
- How can I fix my theme header for my CSS stylesheet?
- How to test another theme in a live WordPress website instead of live preview?
- Update modified Shopify third-party theme [closed]
- how can I re-utilize and class on a child theme
- Providing updates to your WordPress theme
- How do child themes work?
- How to migrate the menu from the site on my own theme in WordPress?
- adding navigation to genesis themes
- Standard Way To Do Custom Work Within A Page?
- Image Size wrong during upload
- The the_post_thumbnail without srcset?
- after_setup_theme always runs
- WordPress API Menu/Submenu Order
- What WP folder can I use to write files to?
- Why I can’t add a CSS style in this WordPress theme?
- Display a different theme for not logged-in users
- Best practice (forward compatibility) for theme options
- Select menu on browser resize
- Can I upload WordPress-react theme in Wp theme repository
- Get list of months with posts
- Cannot get full thumbnail size using the_post_thumbnail
- Version control for both Vagrant config and themes being developed [closed]
- Is there a way to activate different theme for specified users? [closed]
- Unhook action from child theme
- How do I save a wordpress theme’s files and install them on another site?
- Change locale by detecting viewer’s browser language setting and let them choose prefered language after
- Is there any WordPress theme for Self Storagae just like Spacer [closed]
- Customizer: save setting/control content to post/page
- WordPress Unite Theme: Footer isn’t sticking [closed]
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- Customize how a WordPress theme looks like in the Theme Selector
- Widget Option is Missing
- If you were to start using a WordPress framework today, which one would you use? [closed]
- Template for landing pages
- Is it possible to have a theme that uses only one single page?
- underscores use of the article element on the page template
- How to create and populate with few links a menu in child theme functions.php?
- Plugin does not work in custom theme
- html5-reset theme does not show the image [closed]
- Adding a gallery to my first theme
- Understrap-child conditional js script
- How to change listing type permlink?
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- Local variable name in setup_postdata()
- Creating a Single Page Theme correctly
- Edit Product Archive design for Woo theme
- How do I remove header/page-title image in farvis theme? [closed]
- How to connect two child themes on different sub domains to the same base theme
- How to link post image to post link?
- WordPress Theme Developments – Start from another theme
- How to convert that page to a wordpress template? [closed]
- php file child theme directory not overriding parent theme php file [duplicate]
- WordPress theme Modifications not showing up on live server
- add_action works outside condition but not inside it
- Should I create a child theme for a parent custom theme? [closed]
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- My wordpress site memory exhausted more than 1GB trying to debug with default