Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress changing "&&" into "&&"

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.

like image 608
americanknight Avatar asked Nov 24 '22 21:11

americanknight


1 Answers

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.

like image 186
J0ANMM Avatar answered Dec 09 '22 11:12

J0ANMM