Determing If Page is a Calendar Page

Home Forums Calendar Products Events Calendar PRO Determing If Page is a Calendar Page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1017603
    Victoria
    Participant

    How do I go about determining if the current page is one of the Calendar pages (month or list)?

    If I use get_the_ID(), it oddly returns the page ID of the first event on the calendar page….not the top-level/parent page ID.

    Is this a glitch? Is there another way to check?

    Thanks.

    #1017855
    Brian
    Keymaster

    Hello,

    Thanks for using our plugins. I can help out here.

    The main views of Month, List, Map, etc are archives in WordPress so they do not have an id to the get_the_id() will not work as you found out. That is not a glitch, but a result of the setup for the views.

    I have this list of conditionals for you to determine what view you are on:

    https://gist.github.com/jo-snips/2415009

    Let me know if that helps.

    Thanks

    #1018739
    Victoria
    Participant

    Thanks, but this doesnt really help since those conditionals are only available after the EC code is being initialized/generated – and not beforehand via the theme’s functions.php

    I want to be able to change some theme elements if the month/list pages are being viewed. Heck, any of the public EC pages really.

    #1018802
    Brian
    Keymaster

    Hi,

    I use them all the time in the theme’s functions.php you have to load them inside of WordPress’s action and filter system to work correctly.

    http://codex.wordpress.org/Plugin_API/Hooks

    That is all we have for conditionals too.

    #1018804
    Brian
    Keymaster

    If that is not going to work for you. We do have a themer’s guide where you can move and edit any of the event templates in your theme:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    #1024137
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Determing If Page is a Calendar Page’ is closed to new replies.