Title: Reference Calendar Page in Function
Last modified: August 20, 2016

---

# Reference Calendar Page in Function

 *  Resolved [sshilo](https://wordpress.org/support/users/sshilo/)
 * (@sshilo)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/)
 * For styling purposes, I use an IF statement in assigning a particular class to
   certain divs based on either pageid, category, etc.
 * I need a way to reference the calendar page. I created a custom page template(
   calendar.php) and I use it to show the calendar on.
 * If I run this code:
 *     ```
       global $template;
       print_r($template);
       ```
   
 * It shows that that is the template being used, but if I add to my styling function
   the condition
 * is_page_template(‘calendar.php’)
 * it returns “false”.
 * Is there an easier way to reference the page being used?
 * Thanks
 * [http://wordpress.org/extend/plugins/the-events-calendar/](http://wordpress.org/extend/plugins/the-events-calendar/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Rob La Gatta](https://wordpress.org/support/users/roblagatta/)
 * (@roblagatta)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130489)
 * Hey sshilo. Thanks for the note here; we can try and point you in the right direction
   here, certainly. Have you already checked out our documentation page ([http://tri.be/support/documentation/](http://tri.be/support/documentation/))
   and the themer’s guide ([http://tri.be/support/documentation/events-calendar-themers-guide/](http://tri.be/support/documentation/events-calendar-themers-guide/))?
   Best I can tell they should help get you where you need to be, but let me know
   if not.
 *  Thread Starter [sshilo](https://wordpress.org/support/users/sshilo/)
 * (@sshilo)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130518)
 * I looked and could not find it. I tried changing it to
 * `is_page_template('/wp-content/plugins/the-events-calendar/views/ecp-page-template.
   php')`
 * or
 * `is_page_template('ecp-page-template.php')`
 * neither worked. Any help would be greatly appreciated.
 * basically, I need to know what value under ‘is_page_template()’ would return 
   a value of yes for
 *  [Rob La Gatta](https://wordpress.org/support/users/roblagatta/)
 * (@roblagatta)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130577)
 * Thanks for the follow-up, sshilo. This is outside my area of expertise but I 
   can certainly get Jonah from our support team – who is far more code-minded than
   myself – to take a look here. We should be able to get you a response on this
   no later than tomorrow. Thanks for your patience so far and please let me know
   what else I can do in the interim.
 *  [jonahcoyote](https://wordpress.org/support/users/jonahcoyote/)
 * (@jonahcoyote)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130586)
 * Hey sshilo,
 * Here are some conditional wrappers that should help you out: [https://gist.github.com/2415009](https://gist.github.com/2415009)
 * Let me know whether or not that works for you!
 * Cheers,
    Jonah
 *  [Rob La Gatta](https://wordpress.org/support/users/roblagatta/)
 * (@roblagatta)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130598)
 * Hi again sshilo. Just wanted to check on this; need anything else from us after
   reviewing Jonah’s last comment here?
 *  Thread Starter [sshilo](https://wordpress.org/support/users/sshilo/)
 * (@sshilo)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130599)
 * roblagatta, will try it today and update asap. TY Jonah.
 *  Thread Starter [sshilo](https://wordpress.org/support/users/sshilo/)
 * (@sshilo)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130600)
 * that worked great!! TYVM you two!
 *  [Rob La Gatta](https://wordpress.org/support/users/roblagatta/)
 * (@roblagatta)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130614)
 * Excellent to hear! Thanks for confirming, sshilo. Glad to be of service…if you
   need anything else in the future, please let us know. Similarly if you find yourself
   with a few minutes and would be willing to write us a review on the new Reviews
   page here at the dot-org forum, it’d mean the world to us!
 * Thanks again for your support and for using The Events Calendar.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Reference Calendar Page in Function’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Rob La Gatta](https://wordpress.org/support/users/roblagatta/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/reference-calendar-page-in-function/#post-3130614)
 * Status: resolved