Well, I put a printout in parse_templates and found that it's actually being called twice, and I suppose that the list of hooks in the debug info just shows the latest call or something like that. And the first time it's called before the widget code is evaled, so that's probably the problem. I'm not exactly sure why you had it working for widgets, but I'd guess it's because the timing of the first call to parse_templates depends on what's on the page. I have a couple other test widgets and a php page, so one of them is probably triggering the call before it gets to the test widget I created with your code in it.
So I'm not sure how to get around that - I'm not an html expert, is there any reason the CSS and js has to go in the header?
|