There’s nothing wrong with css rules ending up in your inspector twice. In many cases you want the first version, loading both parent and child styles. After all, in that case your child style sheet only needs to have the styles you want different from the parent. The browser will correctly apply the child rule if they’re both there. If the parent theme style sheet is not there and the child theme style sheet is incomplete, your theme will break.
The second version you give indeed only loads the child style sheet. The filter makes sure that if the theme asks for something from the style directory (like an icon or a secondary stylesheet), it is retrieved from the parent directory. If you use the second version, make sure you copy the complete parent style.css
and adapt that one.
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
- why this media query is not working / not loading when I put it in child theme?
- Child theme stylesheet not always overriding “index”
- Child Theme CSS not showing at all
- 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
- Remove Open Sans from Twenty Twelve theme
- Enqueue Google Web Fonts Without Messing Up Symbols In URL
- Inbuilt style for jquery-ui-datepicker
- Why is style.css not being enqueued?
- How to conditionally enqueue a stylesheet only for a certain page(s)?
- Why is the Child Theme Stylesheet Not Loading?
- Is it possible to enqueue a raw CSS string directly from within a template file?
- Give priority to child theme stylesheet
- Use wp_enqueue_scripts, not wp_print_styles?
- How do I remove specific styles from the parent theme css using the child theme css?
- Why isn’t my theme processing SASS?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- Adding style sheet to specific page
- Do I only need to import style.css for a child theme?
- some things in child theme css not overriding parent
- Style.css in child theme is loaded before Bootstrap
- When enqueing a stylesheet, is it possible to remove the type attribute? [duplicate]
- Understanding child theme functions.php
- Load custom css after bootstrap
- De-registering parent style sheet css recommended?
- Enqueue style for Password Reset page
- The correct way to include JavaScript and CSS in my WordPress Themes
- Duplicate and alter sidebar for Twenty Eleven
- Is it possible to change the path of a css file that is registered through wp_enqueue_style()?
- How can I remove css from a child theme?
- Relative path instead of absolute for wp_enqueue_script
- get_stylesheet_uri returns wrong path
- Override load-styles.php with admin screen css
- CSS file not registering through add_action
- Custom Admin CSS styles to style media uploader?
- getting url in wp_enqueue_style
- Is it better to put CSS in additional CSS or in Child theme styles.css [closed]
- 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
- Adding external stylesheet after ALL other styles
- Parent theme CSS overriding child CSS rules
- How to enqueue a random css style?
- WordPress Twenty Fourteen Theme Sidebar
- 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 to organize priority of plugins CSS files?
- 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
- Why is this jquery / java script code not working in mobile / in devices?
- Why is my child theme style.css not found (404) in the front-end? [closed]
- 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?
- functions.php – inject inline css from file
- 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
- 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?
- child theme appears again when I put the header with parent name.
- Load custom CSS before admin CSS
- How would one set or override a Fallback font for characters in second language?
- First element/selector of enqueued CSS file breaks
- get_template_directory_uri() links to child theme not parent
- Child Theme style.css changes aren’t showing. Parent “style-less.css” over rides it, and won’t update
- Css will not display in webpage, after adding it in style.css in child theme
- 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
- WordPress childtheme not loading any CSS/SCSS
- Add inline CSS to login page with wp_add_inline_style
- Bootstrap Integtration
- 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 style of Twenty Seventeen child theme
- Child Theme not loading multiple stylesheets
- CSS in child theme to replace !important in parent theme
- Modify arguments for parent theme’s `wp_register_style` via child theme
- How to make CSS load live based on options clicked in the theme customizer?
- Replacing parent theme’s IE-specific CSS
- 100% Width Footer – Custom Child Theme
- Bootstrap 4 Optimization
- Add Custom CSS Class in Child Theme [closed]
- How to create my own style.css file in an wordpress child-theme
- 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?