Parent vs Child Themes
get_template_directory_uri
always refers to the parent theme you can verify this as you always should when things don’t load as expected by looking in the console in the browsers dev tools. These would show 404 errors for the CSS files, in the wrong folder.
Instead, use get_stylesheet_directory_uri
, the stylesheet
family of functions always refer to the current active theme
Duplicated Names
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version'));
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/css/bootstrap.css', array( $parent_style ), wp_get_theme()->get('Version'));
You can’t call 2 stylesheets the same thing and expect it to work, which is what you’ve done with all 4 of your stylesheets
Also notice that you’ve loaded bootstrap.css
from both themes
Related Posts:
- Child themes CSS priority problems without using !important
- How do I remove specific styles from the parent theme css using the child theme css?
- Do I only need to import style.css for a child theme?
- 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
- some things in child theme css not overriding parent
- Why do WordPress default themes specify fonts in so many places?
- TwentyTwelve versioning
- 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?
- Is it better to put CSS in additional CSS or in Child theme styles.css [closed]
- Font Awesome wp_enqueue_style
- Different ways to load child theme css
- WordPress Twenty Fourteen Theme Sidebar
- Importing changes to Child Theme
- Load in wp admin assets from child theme
- Help with child theme enqueuing additional css files
- How to integrate my HTML and javascript into my child theme
- why this media query is not working / not loading when I put it in child theme?
- Trying to figure out why my child theme is trying to access a file that doesn’t exist
- Child theme CSS not applying to element
- Correct Way To Make Changes To A WordPress Theme
- Child theme stylesheet not always overriding “index”
- Why is this jquery / java script code not working in mobile / in devices?
- Child Theme CSS not showing at all
- Why is my child theme style.css not found (404) in the front-end? [closed]
- How to sync the style in the visual editor with the style of a child theme?
- Remove CSS Attribute by Overriding CSS in Child Theme
- CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS [closed]
- child theme appears again when I put the header with parent name.
- All of my custom Bootstrap styles are not working in my child theme!
- Earlier stylesheet not overriding later one
- 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
- Css will not display in webpage, after adding it in style.css in child theme
- How to enqueue stylesheets in child-theme functions.php?
- Dequeing Parent Fontawesome Deques Parent Styles
- WordPress childtheme not loading any CSS/SCSS
- My Child Theme CSS Isn’t Working
- 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
- Font size decreases when child theme is created from parent theme?
- Change style of Twenty Seventeen child theme
- CSS in child theme to replace !important in parent theme
- Why are my parent styles loading after my child styles?
- 100% Width Footer – Custom Child Theme
- Browser stacks different versions of style.css
- Can’t override CSS with child theme
- Add Custom CSS Class in Child Theme [closed]
- Is there a CSS parent selector?
- How do I hide the bullets on my list for the sidebar?
- What is the difference between visibility:hidden and display:none?
- Center a position:fixed element
- How to change the background colour’s opacity in CSS
- difference between css height : 100% vs height : auto
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- Style something only on the home page
- How do I register/enqueue a custom CSS file?
- add generated stylesheet from parent theme after child-themes style.css
- PageLines theme: how to change the background color of the main content vs. entire page?
- Changing CSS in Twenty Eleven to change font size of body text
- Is it possible to change the path of a css file that is registered through wp_enqueue_style()?
- Adding HTML to the Header, Screws up in IE7
- Efficient way to edit WordPress themes
- Parent theme CSS overriding child CSS rules
- Where Do I Find The Astra Default Font Family That All Text Elements Are Inheriting From? [closed]
- How to organize priority of plugins CSS files?
- Responsive Images Warping
- Remove margin from CSS gradient color code
- How can I use one stylesheet for multiple sub-sites on my multi-site network?
- How do I apply/target CSS to a specific user role or roles?
- Seperate functions.php for part of site
- How can I remove the ::after CSS selector which is automaticaly appended to the_content()?
- Hover colour spreading out beyond submit button
- post_class not working with css
- Using PHP Increment and Conditional Statement to Alternate Loop Background
- How can I make css inline?
- Namespacing theme CSS
- How to change the standard navigation menu color when using genesis [closed]
- Change class names dynamically added to html elements by wordpress
- Add classes + taxonomy terms to wp_list_pages() output
- Chat window hiding behind Twenty Eleven header
- WordPress footer always at the bottom of the screen-page
- Why can’t blocks be hidden with jQuery?
- CSS: Appearance/Customise display different to actual display
- Border around menu button [closed]
- Correct use of !important
- Help locating old custom_css in PHP MyAdmin
- I would like to achieve a two column checkout page
- How would I add this code to a single WordPress page?
- How to change menu hover color to white on my theme? [closed]
- How to make CSS load live based on options clicked in the theme customizer?
- Inserting a DIV Block Into a Listing of Excerpts?
- Do you use css reset in your child theme [closed]
- why does WordPress custom css convert alpha to hex values?
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How to add css to wp_head depending on the user role?
- Editing size of h3 tag in wordpress on a one-off basis
- Content doesn’t fit on large size desktops like 2560×1440