Add js code to all/specific pages
-
Hi,
Is it possible to add js code to all/certian pages of my blog? For example a company that provides visiting statistics. A js code provided by the company should be place in certian place in the page (inside header tag, right after body tag, addidion to the onload of the body tag etc.)
I think in the direction is creating a widget or making an extension of the template (if it is possible at all), is it possible to do this? (If the answer is yes, of course I will research on how to do it, currently I don’t know how widgets technicly work).Thanks.
-
We can’t use Javascript on WordPress.com blogs for security reasons. There are a number of threads about this in the forums; if you do a search for “javascript” I’m sure you’ll come up with them explaining why it’s not possible.
If what you want is a statcounter, you can install a non-javascript version in a text-widget. Somewhere like Sitemeter or Statcounter will give you that option and they work well in tandem with WP’s own stats. Alternatively if you self-host your blog you can use javascript.
http://faq.wordpress.com/2006/05/07/javascript-can-i-use-that-on-my-blog/ -
The js I wanted to put is more sophisticated than a statcounter. Also I wanted to provide users easy-install way of the js code.
Thank you anyway.
-
it sounds like you may be talking about a self-hosted version of the software available from wordpress.org
We use different software here. To read about the differences, please see:
Read Me First
7 Things to Know Before Posting in the WordPress.com ForumsWordPress.org support:
http://wordpress.org/support
- The topic ‘Add js code to all/specific pages’ is closed to new replies.