Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Can I see that running on your site somewhere? Feel free to mail me (futtta at gmail dot com) if you prefer not to post the URL here.

    Plugin Author Frank Goossens

    (@futtta)

    This got solved after some mailing back and fro, but part of the solution merits to be documented.

    Problem was the the javascript in the sidebar relied on jquery. Once both the sidebar-js and jquery were excluded, all worked OK.

    But taking it one step further; as the sidebar-jquery only was shown on one particular case, I propsed the following Autoptimize-API based code to only execute the exclusion on a particular page (e.g. on https://blog.url.net/funtastic/);

    add_filter('autoptimize_filter_js_exclude','herold_ao_override_jsexclude',10,1);
    function herold_ao_override_jsexclude($exclude) {
        if (strpos($_SERVER['REQUEST_URI'],'funtastic')!==false) {
            return $exclude.", goal.js, jquery.min.js";
        } else {
            return $exclude;
        }
    }
    Thread Starter herold

    (@herold)

    Hello Frank,

    Thank you for the support and the custom solution, which works perfect.

    Plugin Author Frank Goossens

    (@futtta)

    Glad to hear that Herold!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Missing Javascript Element in Sidebar’ is closed to new replies.