Main Events Page with Sidebar

Home Forums Calendar Products Events Calendar PRO Main Events Page with Sidebar

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #65187
    Derek
    Participant

    Hello,

    I’m building this website for a client and they want the main events page to show a list of events with a sidebar that has the calendar widget.

    When I try using the default page template, the sidebar shows, but the events listings don’t show correctly.

    When I try using the default events template, the listings show up great, but the sidebar disappears.

    #65284
    Barry
    Member

    Hi Derek:

    One approach would be to customize the default events template and add a sidebar:

    * Themer’s Guide
    * Codex documentation for dynamic_sidebar()

    The other would be to work on the appearance of the calendar when you’re using the default page template (which might be a matter of tweaking CSS some).

    Do you lean towards either of the above approaches?

    #65301
    Derek
    Participant

    Thanks Barry,
    I would prefer to customize the default events template by adding a sidebar. That seems easy enough – but what code would I use in the template php file?

    #65306
    Barry
    Member

    Hi Derek,

    Here’s an example of a customized default-template.php that would add a sidebar in the context of the default Twenty Twelve theme. That should give you a starting point, of course there are likely to be differences with your own theme (unless it is indeed Twenty Twelve or closely based on it).

    Thanks!

    #65309
    Derek
    Participant

    Hi Barry, Can you give me that link again? It said the post has been removed.

    #65310
    Derek
    Participant

    Never mind, I see it now.

    #65312
    Barry
    Member

    Yep – I made an error first time and had to correct it, sorry for the inconvenience!

    #65318
    Derek
    Participant

    Hi Barry, I’m having trouble figuring out what file to update? content.php?

    #65321
    Derek
    Participant

    I copied all the files to /themes/goinggreen/tribe-events/
    Then I edited /themes/goinggreen/tribe-events/views/default-template.php using the code you gave me.
    That didn’t work, so I tried…

    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
    * @since 3.0
    * @author Modern Tribe Inc.
    *
    */

    if ( !defined('ABSPATH') ) { die('-1'); } ?>

    Any ideas? Am I even editing the right file?

    #65322
    Derek
    Participant

    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
    * @since 3.0
    * @author Modern Tribe Inc.
    *
    */

    if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?>

    #65323
    Derek
    Participant

    I don’t know why it won’t show the whole thing…

    #65324
    Derek
    Participant

    #65330
    Barry
    Member

    Hi Derek – the forum doesn’t handle code very nicely at all, unfortunately, so it’s best to share code using a service like Pastebin, Gist or similar.

    Please note that within your theme’s tribe-events directory there is no need for a further views directory – does that help to clarify things?

    #65336
    Derek
    Participant

    Now I see why you used pastebin before! OK, I have it located here now…
    /wp-content/themes/goinggreen/tribe-events/default-template.php

    Here is the code I am using… http://pastebin.com/pTmr2wWB

    #65337
    Barry
    Member

    Hi Derek,

    So if that’s what you’re currently using it does indeed seem to be basically working, albeit the formatting is a bit off.

    Note that in my example I had an opening div tag like so:

    <div id="primary" class="site-content">

    You don’t have that in your snippet, but you do have the corresponding closing tag – so your HTML is basically “unbalanced” … does that help at all?

Viewing 15 posts - 1 through 15 (of 22 total)
  • The topic ‘Main Events Page with Sidebar’ is closed to new replies.