Template File for Single Event

Home Forums Calendar Products Events Calendar PRO Template File for Single Event

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1615584
    swansondesigns
    Participant

    Hello,

    I am just stumped on why the template file being used for a single event is index.php and not single.php. The easy answer is that I’m not following the WordPress Template Hierarchy. But, when I read through how it works, it seems like the correct file would be single-event.php.

    Template Hierarchy

    But, I know that the post type is actually “tribe_events” so it could also be single-tribe_events.php (or, just for grins, single-tribe_event.php).

    Now, I want to be totally clear here, I want to override the template of the page itself, not the content of the page. Specifically, I want to change the sidebar. The file at /the-events-calendar/views/single-event.php has no sidebar. So that can’t help me accomplish this.

    Also, I know that the file in use is index.php because I installed the plugin called “Show Current Template”. You can see the list of files in use in the attached screen shot. I’ve reverted to Twenty Seventeen to eliminate any theme issues.

    Anyway, I feel like I’m missing something obvious but I’ve been at this all morning. If you can just point me in the right direction I’m sure I can handle the rest. Thanks in advance for your help. I hope this post isn’t as stupid as I feel writing it.

    Graham

    #1615801
    swansondesigns
    Participant

    OK, I have been working on this a little since the earlier post and I just made my first breakthrough. I finally got a template file to be used instead of index.php. It was page-events.php. Using page.php doesn’t work. I don’t know why. If I change page-events.php to page.php it just reverts to using index.php. This doesn’t seem to follow the template hierarchy but I’m sure I’m missing something. Just wanted to update you on what I’m seeing.

    Thanks

    #1618090
    Jennifer
    Keymaster

    Hi Graham,

    Thanks for reaching out! Events are a custom post type (tribe_events) which follow a slightly different hierarchy than regular pages…one thing to check here is what you have set under Events > Settings > Display > Events Template – if you have “Default Events Template” selected, then the template used will be default-template.php, found at wp-content/plugins/the-events-calendar/src/views.

    Just to clarify, are you trying to get the events page to use the same sidebar as other pages on your site, or a different sidebar? If you are adding a new sidebar, you could add it here via a template override.

    #1635583
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Template File for Single Event’ is closed to new replies.