Support » Plugin: The Events Calendar » Reference Calendar Page in Function

  • Resolved sshilo


    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;

    It shows that that is the template being used, but if I add to my styling function the condition


    it returns “false”.

    Is there an easier way to reference the page being used?


Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Rob La Gatta


    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 ( and the themer’s guide ( Best I can tell they should help get you where you need to be, but let me know if not.

    I looked and could not find it. I tried changing it to




    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

    Plugin Author Rob La Gatta


    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.

    Hey sshilo,

    Here are some conditional wrappers that should help you out:

    Let me know whether or not that works for you!


    Plugin Author Rob La Gatta


    Hi again sshilo. Just wanted to check on this; need anything else from us after reviewing Jonah’s last comment here?

    roblagatta, will try it today and update asap. TY Jonah.

    that worked great!! TYVM you two!

    Plugin Author Rob La Gatta


    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.