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.

Related posts

Leave a Reply

1 comment

  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.