Skip to content

Instantly share code, notes, and snippets.

@jauhari
Last active February 20, 2017 11:58
Show Gist options
  • Save jauhari/5bf38428d32c0e7ed18eb2c088889b8d to your computer and use it in GitHub Desktop.
Save jauhari/5bf38428d32c0e7ed18eb2c088889b8d to your computer and use it in GitHub Desktop.
Added Custom CSS on WordPress that support Live Preview and bypass any Cache system
<?php
add_action( 'wp_enqueue_scripts', 'idnme' );
function idnme() {
wp_enqueue_style( 'idnme', get_stylesheet_directory_uri() . '/me.css'.get_the_date_hash('Y-m-d His'), array() );
}
function the_date_hash($param = 'Y-m-d H:i:s')
{
echo get_the_date_hash($param);
}
function get_the_date_hash($param = 'Y-m-d H:i:s')
{
return '?hash=' . md5(date($param));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment