Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php “Wordpress更改”&&&引用;变成&&&引用;_Php_Javascript_Wordpress_Include_Character - Fatal编程技术网

Php “Wordpress更改”&&&引用;变成&&&引用;

Php “Wordpress更改”&&&引用;变成&&&引用;,php,javascript,wordpress,include,character,Php,Javascript,Wordpress,Include,Character,我正在使用PHPinclude函数在我的Wordpress页面中包含静态PHP和JS内容(通过ezPHP插件实现)。PHP工作正常,但JS工作不正常。我收到了“非法字符”错误。&&的每个实例都被更改为&&的html代码(我尝试将其包含在这里,但它会呈现字符)。为了解决这个问题,我(1)为我的用户禁用了Wordpress的WYSIWYG编辑器,(2)在设置编写下,取消选中“Wordpress应自动更正无效嵌套的XHTML”,并(3)将以下代码添加到我主题的函数.php: remove_filter

我正在使用
PHP
include函数在我的Wordpress页面中包含静态
PHP
JS
内容(通过ezPHP插件实现)。PHP工作正常,但JS工作不正常。我收到了“非法字符”错误。
&&
的每个实例都被更改为
&&
的html代码(我尝试将其包含在这里,但它会呈现字符)。为了解决这个问题,我(1)为我的用户禁用了Wordpress的WYSIWYG编辑器,(2)在
设置
编写
下,取消选中“Wordpress应自动更正无效嵌套的XHTML”,并(3)将以下代码添加到我主题的
函数.php

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');

但我还是犯了这个错误。我猜它与Wordpress的
esc_html()
函数有关,但我不知道具体是如何实现的。

您可以将javascript文件上载到另一个服务,然后通过添加html块将其导入Wordpress

<script
   type="text/javascript"
   src="https://whatever-url-this-is/myjavascriptfile.js"
></script>


显然,Github不再支持这一点,但是有一些解决方法。

您是否使用
wp\u enqueue\u script
函数包含JS并在
$src
参数上添加查询字符串?