changed how styles are sent to clients, now based on time stamp

This commit is contained in:
Jorge vitrubio.net 2024-04-02 15:03:22 +02:00
parent bdeeb2645a
commit af0186d8d1
1 changed files with 6 additions and 3 deletions

View File

@ -4,10 +4,13 @@
*/
if ( ! function_exists( 'xarxaprod_theme_css_scripts' ) ){
function xarxaprod_theme_css_scripts() {
wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), _S_VERSION );
//https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
// css loaded depending on version number
//wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), _S_VERSION );
// css loaded depending on modified time stamp -> reload on each update of file
// https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
//wp_enqueue_style('main-styles', get_template_directory_uri() . '/css/style.css', array(), filemtime(get_template_directory() . '/css/style.css'), false);
//wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), filemtime(get_stylesheet_uri() . 'style.css'), false);
wp_enqueue_style( 'xarxaprod-style', get_stylesheet_uri(), array(), filemtime(get_stylesheet_uri() . 'style.css'), false);
wp_style_add_data( 'xarxaprod-style', 'rtl', 'replace' );
// https://stackoverflow.com/a/24994304