• In my functions.php I add the following:

    // Google’s CDN for jQuery
    wp_deregister_script(‘jquery’);
    wp_register_script(‘jquery’, “http” . ($_SERVER[‘SERVER_PORT’] == 443 ? “s” : “”) . “://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js”, false, ‘2.1.0’, false);

    // Twitter API
    wp_enqueue_script(‘twitter’, ‘http’ . ($_SERVER[‘SERVER_PORT’] == 443 ? ‘s’ : ”) . ‘://platform.twitter.com/widgets.js’, false, false, true);

    The plugin causes the site to look for locally hosted files instead of on the externally host.

    https://ww.wp.xz.cn/plugins/root-relative-urls/

Viewing 2 replies - 1 through 2 (of 2 total)
  • As far as I can see, to get your script to load correctly you need to comment out the add_filter() call located at about line 333 of the plugin. It looks like this:

    add_filter(
                'script_loader_src',
                array(
                    'MP_WP_Root_Relative_URLS',
                    'proper_root_relative_url'
                )
            );

    Or try the second method here: http://ww.wp.xz.cn/support/topic/blacklist-urls-not-working?replies=8

    place the code at about line 120, just before:
    if (self::$massage) {

    enter urls in the blacklist as root relative urls so you’d add this to the blacklist for jquery
    /ajax/libs/jquery/2.1.0/jquery.min.js

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Unable to enqueue/register external files’ is closed to new replies.