Add sidebar to Events Calendar page template

Community Forums Forums Design Tips and Tricks Add sidebar to Events Calendar page template

This topic is: not resolved

This topic contains 6 replies, has 3 voices, and was last updated by  morktron 1 month, 4 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #61715

    derekalvarez
    Participant
    Post count: 47

    I’m using the Events Calendar Pro plugin with Going Green theme and I’m trying to add my sidebar to the page template they have. Here is the code I’m using…


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

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

    <?php get_header(); ?>
    <div id="tribe-events-pg-template">
    <?php tribe_events_before_html(); ?>
    <?php tribe_get_view(); ?>
    <?php tribe_events_after_html(); ?>
    </div> <!-- #tribe-events-pg-template -->

    </div>

    <div id="sidebar" class="widget-area">

    <?php genesis_sidebar() ?>

    </div>

    <?php get_footer(); ?>

    Where am I going wrong?

    http://test.epicmag.org/events/
    #61728

    braddalton
    Participant
    Post count: 10566

    You may be able to conditionally change the layout using PHP code but not sure as i would need to test it locally with the plugin installed.

    Can you link to the plugin download page please.


    #61729

    derekalvarez
    Participant
    Post count: 47

    Thanks, Brad. Here it is… http://wordpress.org/plugins/the-events-calendar/

    I’ve changed the code a bit and it added the sidebar, but now the sidebar isn’t aligning correctly…


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

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

    <?php get_header(); ?>
    <div id="content" class="content-sidebar-wrap">
    <div id="tribe-events-pg-template">
    <?php tribe_events_before_html(); ?>
    <?php tribe_get_view(); ?>
    <?php tribe_events_after_html(); ?>
    </div> <!-- #tribe-events-pg-template -->

    </div>

    <div id="sidebar" class="widget-area">

    <?php genesis_sidebar() ?>

    </div>

    <?php get_footer(); ?>

    #61750

    braddalton
    Participant
    Post count: 10566

    Can’t you display this calender using a shortcode or PHP tag and use one of the genesis layouts instead?


    #61752

    derekalvarez
    Participant
    Post count: 47

    I might go that way, but the styling doesn’t look as sharp when I tried it… I was figuring this way I’d have to change less code.

    #61810

    derekalvarez
    Participant
    Post count: 47

    I figured it out for anyone else who has this problem…


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

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

    <?php get_header(); ?>

    <div id="content-sidebar-wrap">

    <div id="content">
    <div id="tribe-events-pg-template">
    <?php tribe_events_before_html(); ?>
    <?php tribe_get_view(); ?>
    <?php tribe_events_after_html(); ?>
    </div> <!-- #tribe-events-pg-template -->
    </div>

    <div id="sidebar" class="sidebar widget-area">
    <?php genesis_sidebar() ?>
    </div>

    </div> <!-- #content-sidebar-wrap -->

    <?php get_footer(); ?>

    #125762

    morktron
    Member
    Post count: 4

    Hi Derekalvarez, I’ve spent the whole morning trying to get Events Calendar to work with Genesis – now thanks to you I have it working :)

    Here is the updated code for it to work with Genesis HTML 5 themes. Just put it here: [your-theme]/tribe-events/default-template.php

    If anyone can see any errors or improvements please don’t be shy.

    <?php
    /* Default Events Template - Customised for Genesis HTML5 themes */
    
    if ( !defined('ABSPATH') ) { die('-1'); }
    
    get_header(); ?>
    
    <div class="content-sidebar-wrap">
    
        <main class="content">
            <div id="tribe-events-pg-template">
                <?php tribe_events_before_html(); ?>
                <?php tribe_get_view(); ?>
                <?php tribe_events_after_html(); ?>
            </div> <!-- #tribe-events-pg-template -->
        </main>
        
        <aside id="sidebar" class="sidebar sidebar-primary widget-area">
            <?php do_action( 'genesis_sidebar' ) ?>
        </aside>
        
    </div>
    <?php get_footer(); ?>
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.