Events Pages not showing up in Timber-based theme

Home Forums Calendar Products Events Calendar PRO Events Pages not showing up in Timber-based theme

  • This topic has 1 reply, 2 voices, and was last updated 8 years ago by brookh.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1506981
    brookh
    Participant

    Is there documentation on the changes and naming of the twig files? I have tried standard changes, but haven’t had any success.

    Help.

    #1508048
    Jeremy
    Keymaster

    Hi Brook,

    Thank you for reaching out to us! I would be happy to help you on this.

    To display your Events page on your Timber-based theme, there are a few things to change:

    • First, be sure your Events template is set as Default Events Template (in Events > Settings > Display).
    • Then, open your theme folder, located at wp-content/themes/your-theme/ and create a new folder called /tribe-events (this will be the parent folder that contains all template overrides, cf our Themer’s Guide).
    • Under /tribe-events, create a default-template.php file with the following code:
      <?php /** * Default Events Template * This file is the basic wrapper template for all the views if 'Default Events Template' * is selected in Events -> Settings -> Template -> Events Template.
       *
       * Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php
       *
       * @package TribeEventsCalendar
       *
       */
      
      $context = Timber::get_context();
      Timber::render('templates/events.twig', $context);
      
    • Finally, you can create a twig file to display your calendar and your events. So, in wp-content/themes/your-theme/templates, create a filled called events.twig.
      The code inside should look like this (change the html and the classes depending on your needs):

      {% extends "templates/base.twig" %}
      
      {% block content %}
      <div class="row">
        <div class="col-md-8">
          {{fn('tribe_events_before_html')}}
          {{fn('tribe_get_view')}}
          {{fn('tribe_events_after_html')}}
        </div>
      </div>
      {% endblock %}
      

    Please let me know if this helps.

    Cheers,
    Jeremy

    #1525376
    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 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Events Pages not showing up in Timber-based theme’ is closed to new replies.