Events Manager
Find out if on single event page (4 posts)

  1. creativelifeform
    Posted 4 years ago #

    Hi there,

    so I need to find out where I am when I am on a single event page. How are these pages generated?

    The reason for this is breadcrumbs. So on the events homepage I need the breadcrumbs to read

    Home >> Events (is not a hyperlink)

    And then on an event's page (single event page) I need the breadcrumbs to read:

    Home >> Events (is a hyperlink) >> Event Name

    I've achieved the above via Javascript. The problem is now, I need to do something like

    <?php if(child_of(get_page_ID('events')): ?>

    But I don't think the event single pages are actually children of the events page are they?


  2. creativelifeform
    Posted 4 years ago #

    Hmm I guess I can use the event-single.php template and build the whole page from scratch there. I don't really want to do this though.

    edit: for the time being, I've done this with javascript, showing two divs containing different sets of breadcrumbs and hiding/showing them depending on a single ID that is only present on the single event page. It's lame I know, but it's working.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    there are some functions like is_event_page in em-template-tags.php

    also, if you check em-events.php you'll see in the first function how this is calculated.

  4. creativelifeform
    Posted 4 years ago #

    Oh right! Thanks Marcus I will check it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic