WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
What is the preferred way to add custom javascript files to the site?

I was reading few posts here about this, but all answers are about wp_enqueue_script or something. I'm looking for solution to embed custom JavaScript variable (created by json_encode()) in footer or in header but in admin add_action 'wp_footer' and 'wp_head' are not called. How to embed custom code - not include file.

share|improve this question

marked as duplicate by Brian Fegter, Wyck, kaiser, toscho Sep 30 '12 at 16:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

A completely detailed answer in the link @BrianFegter posted. – Rutwick Gangurde Aug 17 '12 at 5:21

Admin area has its own hooks in header and footer, respectively:

do_action('admin_enqueue_scripts', $hook_suffix);


do_action('admin_footer', '');
do_action("admin_footer-" . $GLOBALS['hook_suffix']);
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.