RSS

Navigation : Home / , , , / Article : How to Display Javascripts in wordpress specific Posts

How to Display Javascripts in wordpress specific Posts

Very ofter you are running a blog and there you need to add some JavaScript files in your blog, If you are running blog hosted on blogspot.com domain or blogger.com and you wish to add JavaScript and code in specific blog post, you can do it manually just by simple coding.but in wordpress blog post you need some plugins that allows you to post JavaScript and code in your specific wordpress blog post.
You can add some code in your specific code in you wordpress blog by using HTML tab just side of visual tab in post editor.
There add some code you wish to add in that specific post and publish, you have done.Adding JavaScript to WordPress by plugin in wordpress is alternative way to add code in wordpress specific post.adding Java Scripts in your specific post of your wordpress blog is not working in HTML editor if your blog like above tricks, You need to have wordpress plugin to add Custom fields shortcode in your wordpress blog.For this you should create custom field & set the value of custom field to that JavaScript code. Then insert a shortcode in your post content which will in turn fetch the value of that custom field.You can download Custom fields shortcode plugin from wordpress.org website.

You need to add  new Custom Field (say js) and paste that javascript code you wish to add in to your wordpress blog specific post.Now switch to HTML mode of your wordpress blog and there pasted the [cf]CUSTOM_FIELD_NAME[/cf] , we used js so we use the code as [cf]js[/cf] in HTML editor of your wordpress blog.That's it.

Related Article : Embed an IFRAME in wordpress blog

 image credit : labnol

Loading

0 Responses to "How to Display Javascripts in wordpress specific Posts"

Do not add any spam messages, as we will strictly delete the spam comments, all content posted on this blog are free for use and for knowledge, do not spoil it with spamming.