Wordpress changing “&&” into “&&”

风格不统一 提交于 2021-01-20 04:38:11

问题


I'm using the PHP include function to include static PHP and JS content within my Wordpress pages (made possible with the ezPHP plugin). The PHP is working fine, but the JS isn't. I'm getting "illegal character" errors. Every instance of && is being changed to the html code for && (I tried including it here, but it renders the character). To try to fix this, I've (1) disabled Wordpress's WYSIWYG editor for my user, (2) under Settings > Writing, unchecked "WordPress should correct invalidly nested XHTML automatically", and (3) added the following code to my theme's function.php:

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

Still I'm getting this error. I'm guessing it has something to do with Wordpress's esc_html() function, but I don't know how exactly.


回答1:


You can upload the javascript file to another service and import it to Wordpress from there by just adding an HTML block.

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

Apparently, Github does not support that anymore, but there are some workarounds here and here.



来源:https://stackoverflow.com/questions/17155680/wordpress-changing-into-038

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!