Are you sure the version is included in style.css
in the right way? In that case this should really work (hook with wp_enqueue_scripts
):
$theme_data = wp_get_theme();
wp_register_style('your-style-handle', get_template_directory_uri() . '/style.css', '', $theme_data['version'], 'all');
wp_enqueue_style('your-style-handle');
While developing you may not want to change the file version in style.css
all the time, in which case you could use filemtime( get_template_directory_uri() . '/style.css' )
in stead of $theme_data['version']
in above code. Codewise that would be the proper thing to do. Otherwise, beware of browser cache issues.
Related Posts:
- De-registering parent style sheet css recommended?
- filemtime(): stat failed warning within a child theme
- Using wp_add_inline_style without a stylesheet
- How important is it to enqueue a theme’s stylesheet?
- how can I add an icon/image for a child theme?
- Enqueue a stylesheet for login page and make it appear in head element
- WooCommerce shop page to use my custom template [closed]
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- Child Theme vs Duplicate Theme Renamed
- Hide a div that is part of all pages on one specific page
- Why I can’t add a CSS style in this WordPress theme?
- How to add Color Picker in Theme Options for the following?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- Adding Action Hooks In Parent Theme For Easier Child Theme Customization
- Adding customizer styles with wp_add_inline_style
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Best practices – Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)
- Add colors to existing color palette without replacing it
- Child Theme not loading parent CSS
- What can I hook into after_setup_theme?
- add generated stylesheet from parent theme after child-themes style.css
- add_image_size is scaling, even though crop is set to true
- Identifying the priority of style.css so I can make a small CSS file load last
- Change Genesis Tag from Page Template [closed]
- How do I get my child-theme to work with my theme’s includes folder?
- Adding inline styles from a widget
- The best way to add stylesheets to WordPress
- How do I get a parent theme modification from a child theme?
- CSS in child theme not overriding the parent theme [closed]
- Advantages of using instead of wp_enqueue_style()?
- Modifying JS files in Child-theme
- How to add dynamic inline style?
- Optimal solution to develop a wordpress theme?
- Enqueued Stylesheets Effecting Admin Styles
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- Nesting Functions within Functions
- Should I update my _s theme?
- Create a theme by combining a parent and a child theme
- How to keep my custom theme changes after updating genesis child theme
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- WordPress Multisite: Have the same header and footer of main-blog on all sub-blogs
- Can a child theme based on Starker theme be released as free to use theme for public use?
- Override Constants in Child theme
- Changing order title and featured image in blog post (Astra theme)
- Loading files for theme and child theme (Require)
- how can I remove the sidebar from my wp homepage [closed]
- Unhook action from child theme
- Does any theme support child theme?
- Am I supposed to create a child theme for every theme I use?
- enqueue_style is not working
- Child themes: disabling the parent
- Dequeue a style file which is making website load slow!
- How to Edit the style of header title of Twenty Eleven Theme?
- How to remove a file included in parent theme with locate_template() via child theme?
- Can’t override template file in child theme
- Is my approach to enqueue styles inefficient?
- Disable wp_enqueue_style for theme on wp-admin
- functions.php not hooking up with style.css
- Cannot figure out how to overwrite files in child theme
- How to add theme support?
- Removing non native customizer settings from a child theme
- How can I let templates choose which stylesheets are enqueued?
- Link to a .po file in a child theme
- Alias to theme folder for local development
- Stylesheet not linking
- Inheritance of parent theme plugin files in a child theme
- Divi Child Theme not appearing in “Themes” [closed]
- Override template file i subfolders
- What happens to child theme if I change to new version of parent theme?
- Include Parent functions.php in Child Theme functions.php
- Theme Loading Into Dashboard
- Injecting a custom sql query into a page/theme
- Select full Image Size on widget “Genesis – Featured Posts”
- How to check if a WordPress core block is active in sidebar
- How to first edit in local WordPress editor on page and the add code?
- Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox
- Child theme enqueue scripts using new functions
- Font Awesome 5 Free – far working but fas is not? [closed]
- Why is it needed to enqueue parent stylesheet in child theme?
- changing blog title to an image using filter function in child theme
- Can´t access child theme´s scripts dependencies found in parent
- Show woocommerce categories on my theme menu styling
- How to override p2 breathe theme plugin in content template file?
- How remove render blocking css from wordpress when you build a theme?
- Child Theme’s style.css not loading in mobile browser
- Is it possible to make *.js and folders visible in theme-editor
- add_filter to parent theme helper class function from child theme
- How to properly create a child theme
- Replace function in a child theme
- Can’t remove DIV from hooks in Storefront child theme [closed]
- Renaming a theme so it aids SEO and the theme used is hidden
- Overrite parent functions using child functions
- How can I override a require() used in functions.php of parent theme to my child theme
- Derive child theme from separate theme
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- How do I use a color from theme options?
- Need help with adding templates (archives and sitemap) to WordPress child theme
- Using a starter theme vs starter theme with child theme
- How to remove ID’s from wp_enqueue_style?