Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1490415

    Hello,
    I am working on the staging site, so without minification plugins and without server-side caching, I would like to see the changes I make immediately. For this reason, I would like to enable time stamp injection after the CSS file name.
    I tried all the options in Enfold > Performance > Unique Timestamp Of Merged Files And WP Object Cache Bug

    The options
    CSS File Compression and Merging
    Javascript File Compression and Merging
    are both disabled.

    Nevertheless, the timestamp does not appear in the code.

    Thank you,
    Mauro

    #1490430

    Hey profumopuntoit,

    Thank you for the inquiry.

    File versioning for resources added by the theme will only be enabled when the compression and merging options are turned on. To make sure that changes are reflected immediately, we recommend disabling the cache plugin while configuring the site. Once you’re done, re-enable it along with the compression options.

    Best regards,
    Ismael

    #1490457

    Hello Ismael,
    I do not want to enable file compression and merging.

    It should be made clear that

    File versioning for resources added by the theme will only be enabled when the compression and merging options are turned on.

    for example, by graying out the option if file compression and merging are not in use, so the user do not waste their time in useless tentatives.

    I tried with script like this and similar without success

    // ============ FORCE CSS VERSION FOR CHILD THEME ============
    function custom_enfold_child_css_version() {
    // Rimuovi TUTTI i possibili caricamenti del CSS child
    wp_deregister_style(‘avia-style’);

    // Registra e carica con versione basata su data di modifica file
    $css_file = get_stylesheet_directory() . ‘/style.css’;
    $version = file_exists($css_file) ? filemtime($css_file) : ‘1.0’;

    wp_register_style(
    ‘avia-style’,
    get_stylesheet_uri(),
    array(),
    $version,
    ‘all’
    );
    wp_enqueue_style(‘avia-style’);
    }

    // Usa priorità ALTISSIMA per eseguire dopo tutto
    add_action(‘wp_enqueue_scripts’, ‘custom_enfold_child_css_version’, 99999);

    // Rimuovi l’azione originale di Enfold (se esiste)
    remove_action(‘wp_enqueue_scripts’, ‘avia_register_child_backend_scripts_styles’, 10);

    can you provide a working snippet please?

    Thank you
    Mauro

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.