Home › Forums › Calendar Products › Community Events › How to check if I’m on a "virtual page"
- This topic has 3 replies, 2 voices, and was last updated 9 years, 10 months ago by Casey.
-
AuthorPosts
-
May 7, 2014 at 9:41 pm #153493arcanepsycheParticipant
I understand that for Community Events the pages like /events/your-events/add are “virtual” meaning they are not real pages with meta data and such. However, in my custom theme, the layout and content of the sidebar of a page is determined by the slug of that page. For instance, another page on my site called “Articles” with a slug of “articles” which automatically loads a sidebar file called “sidebar-articles.php” based on the page’s slug.
So, since the virtual pages don’t have slugs, is there another way to determine whether the user is visiting a virtual page as opposed to a real page? Like a function or something?May 8, 2014 at 8:03 am #153841CaseyParticipantarcanepsyche,
Thanks for getting in touch! The Community Events add-on has two ‘virtual pages’ that you can check for by using the following template tags:- tribe_is_community_edit_event_page() – Returns true if displaying the ‘Edit’ or ‘Submit’ Event form
- tribe_is_community_my_events_page() – Returns true is displaying the ‘My Events’ list page
For further information on the template tags available with the Community add-on, take a look at the Community Documentation. Let me know if that gets you pointed in the right direction, or if you have further questions. Thanks! 🙂
-Casey-
May 14, 2014 at 7:12 am #160657CaseyParticipantI just wanted to follow up and see if you’re all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! 🙂
-Casey-
June 6, 2014 at 6:16 am #208890CaseyParticipantSince I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂
-Casey-
-
AuthorPosts
- The topic ‘How to check if I’m on a "virtual page"’ is closed to new replies.