@pradador I wrote a wordpress plugin that makes this very easy. I'm in
transit now but I will check it in later tonight.
On Oct 8, 2009, at 7:24 PM, pradador <[email protected]> wrote:
I just switched from Radiant CMS to WordPress and one of the things
I'm having trouble with is adding scripts or code to the head section
depending on the page I'm at. In Radiant it was easy since I made a
section that would get inserted into the head of the document so
adding styles/scripts was as easy as typing it in that section.
I know I could add a custom meta key where needed in WordPress, but I
hate editing code in such a tiny text box. So the workaround I'm using
instead is to create empty elements that act as triggers for the
scripts that need to fire. For example, in the page with an accordion,
I create an empty <div id="accordion-1"></div> and then in my site-
wide JS file I do something like if ($('accordion-1'))
{ createAccordion1(); }.
Any one see any pitfalls or have better solutions for the problem?