Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #748444

    Hi,

    I have a small enhancement request.

    I recently tried to move jQuery from header into footer of my website (running Enfold theme). Unfortunately, this turned out to be impossible, because Enfold theme registers avia-compat.js script in header with jQuery as dependency:
    wp_enqueue_script( 'avia-compat', $template_url.'/js/avia-compat.js', array('jquery'), 2, false ); //needs to be loaded at the top to prevent bugs

    I had a look on the avia-compat.js script and there is no line of code in it that utilizes jQuery. It would be perfect, if you could drop the dependency requirement in next version: wp_enqueue_script( 'avia-compat', $template_url.'/js/avia-compat.js', array(), 2, false ); //needs to be loaded at the top to prevent bugs The avia-compat.js would still be included in header, but jQuery could be included in footer with all the other scripts.

    Thanks in advance!

    Greetings,
    Česlav

    #748456

    Hi again,

    I have one more enhancement request :) Currently, Enfold enqueues comment-reply.min.js script even on pages that have comments disabled, because the if-condition is incomplete: if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }

    The if-condition should also include comments_open() check – see the corresponding code in TwentySeventeen for example: https://github.com/WordPress/twentyseventeen/blob/master/functions.php#L313-L315 This way, the script will not be unnecessarily loaded on pages/posts with comments disabled.

    Cheers,
    Česlav

    #750306

    Hi!

    Thank you for using Enfold.

    You can use the “wp_dequeue_script” script to drop the script and then enqueue it again without the dependency but I’m not sure how it will turn out.

    // https://codex.wordpress.org/Function_Reference/wp_dequeue_script

    Example:

    // https://kriesi.at/support/topic/add-css-class-when-submenu-become-fixed-sticky-on-scroll-not-in-avia-js/

    You need to adjust the values. For feature request, please visit the following link.

    // https://kriesi.at/support/enfold-feature-requests/

    Regards,
    Ismael

    #750381

    Hi Ismael,

    Thanks for reply! I have edited the theme directly for now. I’ll submit these two as feature requests then and will hope that they’ll get included :) If not, I’ll resort to script re-queueing.

    Cheers,
    Česlav

    #750820

    Hi Česlav,

    Great, thanks for the feedback. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #750879

    Hi Rikard, yes, you can close this topic!

    #751211

    Hey!

    Alright. We will keep the thread open for now. Please update us here if you come up with anything. :)

    Cheers!
    Ismael

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