Ways to Add JavaScript to WordPress Posts or Pages
You might have modified your WordPress theme to add a JavaScript code but there are times when you may want to add JavaScript to a specific post or page. So, In this post I will explain you how to add JavaScript code to single WordPress post or page.
- If you are running a self hosted WordPress blog than you can simple add the JavaScript code to your post through the built-in editor, just switch to HTML mode and paste the code.
- Alternatively, you can install a WordPress Plugin “Allow Javascript in Posts and Pages” which enables you to add JavaScript to blog posts and pages just by adding a simple short-code.
- And if you don’t want to install an extra plugin to your WordPress Blog you can simply add a Custom Field (js)and paste the JavaScript code into the Value field. After that just add short-code in your post –[cf]js[/cf]
.
bubbleindia[dot]com thanks for this guide im using this for personal reference