random css

/**
* Enqueue scripts and styles for random version of stylesheet.
*/
function cssrandom_scripts() {
$rand = rand(1, 99999999999);
wp_enqueue_style( ‘html5blank-style’, get_stylesheet_uri(), ”, $rand );

wp_style_add_data( ‘html5blank-style’, ‘rtl’, ‘replace’ );

if ( is_singular() && comments_open() && get_option( ‘thread_comments’ ) ) {
wp_enqueue_script( ‘comment-reply’ );
}
}
add_action( ‘wp_enqueue_scripts’, ‘cssrandom_scripts’ );

/*add category class in body*/
add_filter(‘body_class’,’add_category_to_single’);
function add_category_to_single($classes) {
if (is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->category_nicename;
}
}
// return the $classes array
return $classes;
}

/**
* End of Enqueue scripts and styles for random version of stylesheet./**/

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*