[php]function my_scripts_and_styles(){ $cache_buster = date("YmdHi", filemtime( get_stylesheet_directory() . '/css/main.css')); wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/css/main.css', array(), $cache_buster, 'all' ); } add_action( 'wp_enqueue_scripts', 'my_scripts_and_styles', 101);[/php]
Im BeTheme:
[php]/* --------------------------------------------------------------------------- * Enqueue Style * --------------------------------------------------------------------------- */ add_action( 'wp_enqueue_scripts', 'mfnch_enqueue_styles', 101 ); function mfnch_enqueue_styles() { // Enqueue the parent stylesheet // wp_enqueue_style( 'parent-style', get_template_directory_uri() .'/style.css' ); //we don't need this if it's empty // Enqueue the parent rtl stylesheet if ( is_rtl() ) { wp_enqueue_style( 'mfn-rtl', get_template_directory_uri() . '/rtl.css' ); } $cache_buster = 15; $cache_buster = date("YmdHi", filemtime( get_stylesheet_directory() . '/css/main.css')); // Enqueue the child stylesheet wp_dequeue_style( 'style' ); wp_enqueue_style( 'style', get_stylesheet_directory_uri() .'/style.css' ); wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/css/main.css', array(), $cache_buster, 'all' ); }[/php]
Related Articles
- Fix Elementor fixed Background sizing
- Cronjob Überlappung verhindern – flock()
- WordPress Update Hinweise deaktivieren
- WP Download Manager "attached file is missing/deleted" Fehler
- WordPress Staging: Uploads Ordner von Production Seite einlesen (per htaccess)
- WC Attribute Komma durch Linebreak ersetzen
- User Meta field nach User Role summieren
- SASS starten
- Sublime Text für WordPress einstellen