wp_enqueue_script从绝对网址中剥离域名(google maps api)论文2.1.4

时间:2013-11-21 16:31:54

标签: wordpress google-maps rackspace-cloud wordpress-thesis-theme

试图想出这个...我有一个插件使用wp_register_script注册google maps api url然后使用wp_enqueue_script调用它,这对我来说都是正确的。当页面呈现时,域名已从网址中删除,因此它在该点调用相对路径并破坏脚本......任何想法

worpress:7.1 论文:2.1.4

// register the script
    wp_register_script( 'map_list-google-places', 'http://maps.googleapis.com/maps/api/js?sensor=true&libraries=places' . $languageString);

//Load google maps
    wp_enqueue_script( 'map_list-google-places');  
中的

<script type='text/javascript' src='/maps/api/js?sensor=true&#038;libraries=places&#038;ver=3.7.1'></script>

1 个答案:

答案 0 :(得分:2)

在这里回答我自己的问题。有一个名为Relative Root Plugin的插件,在我的服务器(Rackspace Cloud Sites)旋转Wordpress网站时安装。

简单地停用或删除插件。 DONE。