[wp-hackers] JS file call

Jesus Lizama beautifulcrimes at gmail.com
Fri Mar 18 20:51:28 UTC 2011


Yeah, I'd go with the if (is_page('$arg')) {} method. I'm doing something
similar to that on a current project.

On Fri, Mar 18, 2011 at 1:48 PM, Eric Mann <eric at eam.me> wrote:

> I would recommend using a custom page template for your contact page.  Then
> you can enqueue your script only when that template is being used.  This
> way
> you don't need to remember shortcodes, know the page ID in advance, or do
> anything hacky with custom values.
>
> On Fri, Mar 18, 2011 at 1:42 PM, SWORD Studios <info at swordstudios.net
> >wrote:
>
> > I have a form on a contact page that requires a js file.  I don't want to
> > unnecessarily call this js file through out the site but rather only on
> > this
> > page that needs it.
> >
> > I don't want to call it in the page content it's self.
> >
> > I figured I could do one of a couple things but I wanted to get some
> > feedback on what's best practice.
> >
> >   - Create a shortcode in the content to grab the js file
> >   - put an if statement in the header with the page id
> >   - create a custom value that would be set to true if we want it pulled
> >   in
> >
> > --
> >
> > *Jesse Friedman*   Founder / Lead Developer
> > *SWORD Studios* | 508.50.SWORD info at swordstudios.net
> > swordstudios.net @professor <http://twitter.com/professor>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Jesus Lizama
Developer/Designer
Spifffy.com | ConquerLA.com | Bassdump.com
Cell: (323)336-2953


More information about the wp-hackers mailing list