WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] Reference Calendar Page in Function (9 posts)

  1. sshilo
    Member
    Posted 1 year ago #

    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/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    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/) and the themer's 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.

  3. sshilo
    Member
    Posted 1 year ago #

    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

  4. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    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.

  5. jonahcoyote
    Member
    Posted 1 year ago #

    Hey sshilo,

    Here are some conditional wrappers that should help you out: https://gist.github.com/2415009

    Let me know whether or not that works for you!

    Cheers,
    Jonah

  6. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

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

  7. sshilo
    Member
    Posted 1 year ago #

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

  8. sshilo
    Member
    Posted 1 year ago #

    that worked great!! TYVM you two!

  9. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic