You could change the file version each time the file gets updated. To do this, go to your functions.php
file and find where the style-sheet is being enqueued (or registered) – it will look something like:
wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.css' );
and change it to:
wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.css', array(), filemtime( get_template_directory_uri() . '/style.css' ) );
This will change the file version each time you save it, forcing the new version to get loaded.
As you very correctly pointed out, the styles have to be properly added in functions.php
, not hard-coded in header.php
or elsewhere.
Related Posts:
- The the_post_thumbnail without srcset?
- after_setup_theme always runs
- WordPress API Menu/Submenu Order
- How to move page template files like page-{slug}.php to a sub-directory?
- Add custom classes to anchor in wp_nav_menu
- What WP folder can I use to write files to?
- Are the WordPress Core CSS styles really all nessesary?
- Why I can’t add a CSS style in this WordPress theme?
- register_sidebar ignores ‘id’ and ‘class’
- Display a different theme for not logged-in users
- Best practice (forward compatibility) for theme options
- Add colors to existing color palette without replacing it
- Single Page WordPress Theme – Using page templates
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Select menu on browser resize
- Returning Variables back into a template
- new theme permissions don’t allow me to edit
- Upgrading a custom theme through the Dashboard
- Which theme foundry has clean coded themes, where code is poetry [closed]
- What page should I use for a contact form?
- Retrieve data using wpdb to use for customizer controls
- How can a Theme Contain no Header File or Footer File?
- Cannot get full thumbnail size using the_post_thumbnail
- Is there a way to activate different theme for specified users? [closed]
- how can I remove the sidebar from my wp homepage [closed]
- Some translations do not work in my template class
- WordPress not registering Theme Customization Section
- How to remove a file included in parent theme with locate_template() via child theme?
- qTranslate with my own theme and settings
- Stylesheet not linking
- How to control layout of posts on page?
- Override template file i subfolders
- Theme Development for WordPress Multisite Installation
- How to add infinite scroll?
- get_option in header.php not returning value from customizer
- Include Parent functions.php in Child Theme functions.php
- create category on theme setup
- Why is it needed to enqueue parent stylesheet in child theme?
- WordPress Unite Theme: Footer isn’t sticking [closed]
- WordPress get_template_part() function not working
- Is accessing theme and using customizer GPL distribution?
- Where am I doing wrong in my theme menu?
- How can my theme allow users to take advantage of advanced html tags in posts
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- Customize how a WordPress theme looks like in the Theme Selector
- How to set a page as homepage in stead of the newspages?
- how to get the post attachement image in full size?
- Best way to develop a new theme on a live site, with new content? [closed]
- How do I make the most minimal vanilla theme possible with nothing but raw content?
- Can I Set Up Session in WordPress Custom Page
- WordPress Theme Validator?
- Template for landing pages
- Set a featured image as a replacement to the header image
- Custom theme: How to call archive-post.php for viewing blog posts
- html5-reset theme does not show the image [closed]
- Theme Customizer not displaying saved values in wp_head (CSS)
- How can I hard code my sidebar?
- What exactly is “wordpress theming”? [closed]
- Thesis -style Navigation
- How can I wrap all blog posts image with
- Valid SQL query not returning results
- How do I include a partial from a directory below a wordpress theme directory?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- Change Image Sizes for Mobile Theme
- Recommended sidebar / content widths
- Converting a theme to a child theme in a network
- showing all recent posts in theme
- What is the difference between Twenty eleven & roots framework?
- List categories of a post hierarchically?
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- How to change listing type permlink?
- Adding popup support to the theme
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- How to make updatable custom WordPress theme?
- How can I access variables from theme in child theme? [closed]
- Local variable name in setup_postdata()
- Creating a Single Page Theme correctly
- Is it possible to echo a woocommerce prouct attribute discription?
- Child theme menu not appearing in Twenty Seventeen
- How do I remove header/page-title image in farvis theme? [closed]
- How to link post image to post link?
- WooCommerce – edit templates
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- On wordpress, how do i require specific dimensions from user uploads only
- WordPress Theme Developments – Start from another theme
- Slider should be display in home template [closed]
- Modify comments_popup_link output
- Best strategy for providing theme options using customizer
- Next post in category
- Can you create a custom page with content in the center already defined?
- How to migrate the menu from the site on my own theme in WordPress?
- RSS feed url showing page not found. How to solve it?
- How to convert that page to a wordpress template? [closed]
- Toolbox theme using printif statement – help needed understanding code block
- php file child theme directory not overriding parent theme php file [duplicate]
- Any Cool WordPress Theme Editor? [closed]
- How to Create a Multi Purpose Theme?
- Custom Single Page Portfolio Theme [closed]
- What is the point of using the front-page.php template? [closed]