[wp-hackers] Load scripts in header only when needed
photofantaisie at gmail.com
Sat Nov 29 20:30:44 GMT 2008
Very useful. I've bookmarked it for future reference. Thanks!
But what about non-admin pages? How do I avoid loading the js in every
non-admin page, given that I only want the js on pages (most likely single
post or page.php or a page template) where the gallery is called?
2008/11/29 Ozh <ozh at planetozh.com>
> Should help :
> On Sat, Nov 29, 2008 at 3:14 PM, Ade Walker <photofantaisie at gmail.com>
> > Hi all,
> > I've probably been staring at the computer screen too long, but I'm
> > struggling to get my head around this...
> > gallery will be called by a function call in a theme template file.
> > I only want to load the scripts into the header on pages that actually
> > it. The problem is that if I try to load the scripts into the head based
> > the template function call it's too late - wp_head has been and gone.
> > If anyone could point me in the right direction I'd be very grateful. :-)
> > Thanks.
> > Ade.
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> http://planetOzh.com ~ Blog and WordPress Stuff
> http://FrenchFragFactory.net ~ Daily Quake News
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers