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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With