[wp-hackers] JS file call

Eric Mann eric at eam.me
Fri Mar 18 20:48:33 UTC 2011

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

More information about the wp-hackers mailing list