• Resolved crystalcommerce

    (@crystalcommerce)


    I am setting up a navigation that detects which page is being viewed and then adds a new class to that item which changes the color of the link.

    I am using <?php if (is_page('calendar')){echo "active";}?> but this does not seem to detect the calendar page.
    Does anyone know what I will need to look for to grab it? I would like it to work no matter what they are viewing as long as it belongs to the calendar.

    Here’s the page I am currently building:
    Legends Comics

    Thanks,

    Andy
    Crystal Commerce

    https://www.ads-software.com/extend/plugins/the-events-calendar/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey Andy. Thanks for the heads up on this and it’s interesting to hear what you’re doing. While I’m not sure about this one myself I’d be happy to get our dev Jonah to take a look and try to respond here. Stay tuned and thanks for your patience/support so far.

    Hi Andy,

    This should help: https://gist.github.com/2415009

    Let me know if not ??

    – Jonah

    Thread Starter crystalcommerce

    (@crystalcommerce)

    Thanks Jonah I can use this for a lot of things.
    Is there any snippet that will just detect if the entire calendar and it’s events are being viewed as a whole? So I won’t need to use such a long if statement? If not I will just use this.

    Thanks again,

    Andy

    Hey Andy, well you don’t need to use the whole thing. You can use whatever chunk you want – i.e. just:

    if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
    
    }

    to check for just the calendar page. Make sense?

    Thread Starter crystalcommerce

    (@crystalcommerce)

    Yea it totally does, I just want to change the color for every section of the calendar, just to show that the user is in the calendar section.

    Andy

    Thread Starter crystalcommerce

    (@crystalcommerce)

    Alright I got it to work like this, for anyone else wanting to know how it’s done.

    <?php $calendar = array('tribe_is_month()','tribe_is_event()','tribe_is_day()','tribe_is_venue()'); ?>
    <a href="#" class="<?php if ($calendar){echo "active";}?>">Calendar</a>

    Thanks for your help.

    Andy

    Awesome to hear this got you where you needed to be, crystalcommerce. If you need anything else or if we can assist at all down the road, do let us know. Otherwise…if you’d be so kind as to give us a “Works” rating or a positive star vote here on the www.ads-software.com repo…we sure would appreciate it ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: The Events Calendar] How to detect if the user is viewing the calendar?’ is closed to new replies.