Please use this instead of what you are using. This will definitely work.
<?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' );
?>
For more details on configuring Child themes in WordPress please refer to this link.
Related Posts:
- How Can I Use A Child Theme Effectively When Parent’s CSS Is Located in a ‘CSS folder’?
- Disable child theme css on certain pages
- Different ways to load child theme css
- why this media query is not working / not loading when I put it in child theme?
- Child theme stylesheet not always overriding “index”
- CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS [closed]
- How to enqueue stylesheets in child-theme functions.php?
- Dequeing Parent Fontawesome Deques Parent Styles
- My Child Theme CSS Isn’t Working
- Font size decreases when child theme is created from parent theme?
- Why are my parent styles loading after my child styles?
- Browser stacks different versions of style.css
- Inbuilt style for jquery-ui-datepicker
- Child themes CSS priority problems without using !important
- Why is style.css not being enqueued?
- How to conditionally enqueue a stylesheet only for a certain page(s)?
- How to enqueue style before style.css
- What is the correct way to enqueue multiple CSS files?
- Remove wp_add_inline_style
- Give priority to child theme stylesheet
- Use wp_enqueue_scripts, not wp_print_styles?
- Do I only need to import style.css for a child theme?
- some things in child theme css not overriding parent
- Child Theme Not Overriding Parent Theme
- Style.css in child theme is loaded before Bootstrap
- When enqueing a stylesheet, is it possible to remove the type attribute? [duplicate]
- CSS in child theme not getting loaded
- TwentyTwelve versioning
- Understanding child theme functions.php
- Load custom css after bootstrap
- De-registering parent style sheet css recommended?
- Enqueue style for Password Reset page
- How to change Parent Themes in Child Theme CSS
- Duplicate and alter sidebar for Twenty Eleven
- How can I remove css from a child theme?
- Relative path instead of absolute for wp_enqueue_script
- Override load-styles.php with admin screen css
- CSS file not registering through add_action
- Relative path in wp_register_style not working
- Custom Admin CSS styles to style media uploader?
- getting url in wp_enqueue_style
- How the Css File is Linked without calling it in header.php?
- Loading different stylesheet on WordPress pages?
- Use wp_add_inline_style to add code to before wp_head?
- why enqueued styles in header.php shows in footer?
- Font Awesome wp_enqueue_style
- How to insert html/css/javascript code to wordpress plugin
- Adding external stylesheet after ALL other styles
- How to enqueue a random css style?
- WordPress Twenty Fourteen Theme Sidebar
- Importing changes to Child Theme
- How to override Bootstrap css with my child theme css in wordpress?
- Load in wp admin assets from child theme
- Enqueue styles in new site editor in WordPress 5.9
- Help with child theme enqueuing additional css files
- How to integrate my HTML and javascript into my child theme
- How do I make header.php use different css for different pages?
- Trying to figure out why my child theme is trying to access a file that doesn’t exist
- Load CSS in footer, like your can with JS?
- Child theme CSS not applying to element
- Correct Way To Make Changes To A WordPress Theme
- Faster fonts on mobile
- Display Something in the Header After All Styles are Loaded
- My CSS suddenly doesn’t load anymore [closed]
- How to sync the style in the visual editor with the style of a child theme?
- How can I force Dynamic CSS via ACF values to update on page load?
- Remove CSS Attribute by Overriding CSS in Child Theme
- Append style tag in head while shortcode runs
- How can I move my custom css to the very bottom of the head section?
- enqueing Javascript and CSS
- Parent theme styles overriding child theme CSS [closed]
- Including CSS files in HEAD based on page content
- All of my custom Bootstrap styles are not working in my child theme!
- How would one set or override a Fallback font for characters in second language?
- Earlier stylesheet not overriding later one
- First element/selector of enqueued CSS file breaks
- get_template_directory_uri() links to child theme not parent
- Free theme and css/bootstrap.css is not overridden in the child theme
- Child Theme style.css changes aren’t showing. Parent “style-less.css” over rides it, and won’t update
- Why would the child theme load in the Customize preview, but not on the site itself?
- Dequeue styles with query doesn’t work
- Save custom option in CSS file
- Add inline CSS to login page with wp_add_inline_style
- Set different css stylesheet for specific pages [duplicate]
- all of a sudden my child theme style.css is being ignored? Its been working fine for months?
- Change WP Child theme CSS for WP Bootstrap Starter Theme
- Change style of Twenty Seventeen child theme
- Child Theme not loading multiple stylesheets
- Controling css order
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Replacing parent theme’s IE-specific CSS
- 100% Width Footer – Custom Child Theme
- Bootstrap 4 Optimization
- Can’t override CSS with child theme
- Add Custom CSS Class in Child Theme [closed]
- How to create my own style.css file in an wordpress child-theme
- Enqueue MCE Editor CSS in admin page
- plugin not loading my css and js
- Custom theme – Bootstrap CSS not loading via wp_enqueue_style or otherwise
- How enqueue CSS out of theme folder?