I am used to of adding javascript/jquery code in posts via visual editor but it seems I never used && operator cause wordpress is altering && operator in &. Here is a link where I am using &&.
http://demo.techstriders.com/corey/canyon/calculator/
I am wondering what is correct way of using javascript in wordpress visual editor.
1 comment
Comments are closed.
You should use wp_enqueue_script for your javascript files instead of adding the code directly into the post content.
ps:
You can check out the callbacks on the
the_content
filter, usingto display them in the footer part of your theme. Then you will see callbacks like
wpautop
,wptexturize
,convert_chars
andconvert_smilies
.I don’t recommend it, but it is possible to remove these filters to use javascript code in the post content: