Home Forums Event Espresso Premium Loading a script on a specific page

Loading a script on a specific page

Posted: December 14, 2012 at 10:00 am


December 14, 2012 at 10:00 am

I added a Google Maps display via their API and the gMap plugin to my events’ pages, that is, in registration_page_display.php. I add the scripts in registration_page.php like so:

function addGoogleMapScripts(){

The problem is that these things are being loaded on ANY page of the website, whether they’re related to Event Espresso or not. Where/how can I add these scripts so that they only load on the event information page?


December 17, 2012 at 2:11 am


Why not just using the Venue shortcode? It has Google maps functionality built in.

Otherwise I would say take a look at the is_page() function


December 17, 2012 at 7:04 am

Ah, it’s funny I searched through the support section and I did not see that shortcode. I’ll try that out.

While we’re on the subject, I tried using is_page() but I couldn’t figure out what the correct parameter should be. I tried the slug that appears on a single event page, is_page(‘event-information’), and the slug of my event calendar page, is_page(‘event-calendar’), but neither worked. What is the right parameter for a single event page?


  • Support Staff

December 17, 2012 at 2:04 pm

Hi Spark,

You could try creating a single event page by using the [SINGLEEVENT] shortcode on the page, and use the slug or the page ID for that page. A single event page that gets dynamically generated from the [ESPRESSO_EVENTS] shortcode will share the same slug and page ID will all the other events.

The support post ‘Loading a script on a specific page’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso