Skip to:
Content
Pages
Categories
Search
Top
Bottom

Force stylesheet refresh in WP and bbP


  • Tom(dB)
    Participant

    @tomdebruin

    For WordPress:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

    For bbPress:

    <link rel="stylesheet" href="<?php bb_stylesheet_uri(); echo '?' . filemtime( bb_get_active_theme_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

    Creates a unique number (based on time) after the filename which is automatically updated if make a change to your stylesheet.

You must be logged in to reply to this topic.