I think you can try with this code below.
function childtheme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->parent()->get('Version') );
wp_enqueue_style( 'child-style',
get_stylesheet_uri(),
array( 'parent-style' ),
wp_get_theme()->get('Version') // Note you must provide a version into the child theme
);
}
add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles' );
Related Posts:
- I created a child theme and it doesn’t work for some of the css files
- Child Theme Not Overriding Parent Theme
- How to override enqueued styles using a child theme
- Parent theme styles overriding child theme CSS [closed]
- get_template_directory_uri() links to child theme not parent
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- Looking for Functions File that doesn’t Exist
- Add custom css file after plugin css with WordPress Child Theme functions.php
- How do I create a child theme from PowerMag theme
- Child Theme not loading multiple stylesheets
- Proper way to load styles using a child theme
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- remove_action on after_setup_theme not working from child theme
- Remove type attribute from script and style tags added by WordPress
- Adding a second email address to a completed order in WooCommerce [closed]
- How to load scripts/styles specific for a page
- Child theme – Overriding ‘require_once’ in functions.php
- Include files in child theme functions file
- Redeclare a function in a child theme
- How to override a function when isn’t at functions.php
- Child theme functions.php do I use php open and close tags?
- Declaring an instance of class included in parent theme from child theme functions.php
- One Child Functions.php for Multiple Child Themes
- Removing custom background and header feature in child theme
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- How to override functions.php in child theme?
- How to display error messages using WP_Error class?
- Overriding core functions in child theme
- TinyMCE custom stylesheets for different post types
- is_front_page not working in functions.php
- Override parent theme function that is not hooked or in the functions.php file
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- Dequeue Scripts and Style for Mobile not working?
- How to override filter in child theme?
- Remove Menu Page Giving Error
- add sidebar area to header of child theme
- Unregister Nav Menu with fallback?
- Enqueue script o style only if a template part is loaded
- Enqueue styles after a plugin
- Changes to functions.php not working
- Overriding methods in a child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Functions.php reverted to new one
- Using the child theme functions.php to change the customizer.php on parent theme
- Child theme functions.php not executing
- How to store / access files in child theme folder
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Overwrite Parent Theme add_image_size in Child Theme
- Why is my Gutenberg block returning an error after initial save?
- If is multiple page templates
- Proper way of using functions in action hook?
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- Debugging with functions.php
- how to edit functions.php in a child theme
- Best practice when altering a parent theme function inside a child theme?
- How to make child theme inherit parent custom theme options [closed]
- Register and enqueue style.css custom theme
- Include files in child themes, declare in functions.php
- How to remove set_post_thumbnail_size() in child themes?
- Enqueue scripts not working with if is page conditional tag in functions.php
- Avoid loading css from parent theme
- Enqueue Style Only On Certain Pages Not Working
- Creating a child theme – functions.php code issue
- Echo tags used to describe the theme
- functions.php How to add css/js depending on Template Name?
- Overwriting Parent Theme’s Image Sizes
- Child theme within a child theme?
- Problem only while using require_once() within functions.php
- Only let plugin add actions to wp_head & wp_footer on single posts
- How can I change a function in a parent theme via a child themes functions.php
- Twentyten Child Theme: header images display messed up in admin panel
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- Why is functions.php file in child not initializing and over-writing parent?
- Child theme .css files are not overriding their parent .css files
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Remove stylesheets from Campaign Monitor plugin
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- enqueue styles for only mobile wp
- Parse error after modifying the template menu [closed]
- Reuse variable in hook callback
- Automatically include all php files in a child theme directory
- Override the function twentytwelve_scripts_styles in a child theme
- Add custom function to a theme with child theme’s functions.php
- Pagination in relation to archive.php
- Skeleton Child Theme Add Icon Bar to Header Flex Grid