Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Alexey Golubnichenko

    (@agolubnichenko)

    Hi Michelle,

    You can try to use following code in the funcions.php of your theme:

    add_action( 'wp_enqueue_scripts', f039924_enqueueScripts, 100);
    function f039924_enqueueScripts () {
        wp_dequeue_script( 'fac-mobile' );
        wp_dequeue_script( 'fac-slider' );
        wp_dequeue_script( 'fac' );                                                         
    
        wp_enqueue_script( 'fac-mobile', Fac()->getAssetUrl('libs/jquery.mobile.min.js'), array('jquery'), false, true );
        wp_enqueue_script( 'fac-slider', Fac()->getAssetUrl('libs/responsiveslides.js'), array('jquery'), false, true );
        wp_enqueue_script( 'fac', Fac()->getAssetUrl('js/main.js'), array('jquery', 'fac-mobile', 'fac-slider'), false, true );
    }

    This code allows you to replace javascripts of my plugin to the site footer, but without any garanty from my side that plugn will work properly.

    Pls let me know if this will help you.

    Regards,
    Alexey.

    Thread Starter FriendlyWP

    (@mmcginnis)

    Thanks Alexey! I get this error when I try that:

    Call to undefined function Fac()

    Plugin Author Alexey Golubnichenko

    (@agolubnichenko)

    That is bit strange, because this function is provided by my plugin and can be undefined only, when the plugin is not activated or not installed at the moment

    Thread Starter FriendlyWP

    (@mmcginnis)

    Totally my bad – sorry! Your original code works. Thank you!

    Plugin Author Alexey Golubnichenko

    (@agolubnichenko)

    Not a problem.
    I hope this helps you.

    Thread Starter FriendlyWP

    (@mmcginnis)

    Sorry – found one more issue – I can’t seem to get the responsiveslides.js to stop loading. I turned off the “slider” option and tried to dequeue the script without re-enqueuing it, but it still gets loaded. Is it necessary if I’m not using the slider option?

    Thanks!

    Plugin Author Alexey Golubnichenko

    (@agolubnichenko)

    That’s right. Unfortunately the plugin loads all scripts regardless of plugin settings. I will fix it in a future release.

    Plugin Author Alexey Golubnichenko

    (@agolubnichenko)

    Currently I mark this topic as resolved. If you have other questions or comments you can reopen this topic or create a new one.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Load scripts in footer?’ is closed to new replies.