WordPress不识别简单的Javascript文件


WordPress not recognizing simple Javascript file

好的,我已经上传了这个super简单的HTML页面在这里:

http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html

它利用了LinkedIn的"Sign In"API。查看源文件。只有两行代码。没有。

,

我在子主题目录下创建了一个home.php文件,并粘贴如下:

<?php require(CHILD_DIR.'/test.html'); ?>

这意味着如果您在http://www.medicaldevicesgroup.net/上查看源代码,它与http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html上的源代码完全相同。唯一的区别是首页是在WordPress中,而另一个URL不是。

但是,主页脚本不起作用。为什么? ?的帮助!谢谢。

原因是因为您正在使用的LinkedIn API是用于http://medicaldevicesgroup.net而不是http://www.medicaldevicesgroup.net。注意第二个URL中的"www"。你需要在LinkedIn API中更改你的URL。

要明白我的意思,试着去http://www.medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html,它也不会工作。