I’m working on a website for a client and I would like a way for them to enter javascript directly into the footer while editing the blog post. The Javascript would be different for each blog post so it can’t be predefined and .
The way it works now, They create a blog post, enter the content, and then go to the widget area and drag a widget to the “Javascript” widget area where they can paste in the javascript surrounded by tags.
Instead of going this route, Is there a way to add a textarea where they can paste in the … so it will appear directly in the footer right before the tag?
This may help. http://codex.wordpress.org/Function_Reference/add_meta_box
Also a much easier route would be custom fields http://codex.wordpress.org/Custom_Fields. You can create a custom field for the post page and insert this field into to page where you need it, probalby in the single.php.
Either way, I would do some validating of the content before you insert it into the page. Users may forget to add proper script tags or misformat their content, which could break your page.