Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add sidebar to Events Calendar page template
Tagged: events calendar, going green, Sidebar
- This topic has 6 replies, 3 voices, and was last updated 9 years, 11 months ago by morktron.
-
AuthorPosts
-
September 10, 2013 at 11:44 am #61715derekalvarezMember
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/September 10, 2013 at 12:45 pm #61728Brad DaltonParticipantYou 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.
September 10, 2013 at 12:47 pm #61729derekalvarezMemberThanks, 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(); ?>
September 10, 2013 at 1:47 pm #61750Brad DaltonParticipantCan't you display this calender using a shortcode or PHP tag and use one of the genesis layouts instead?
September 10, 2013 at 2:07 pm #61752derekalvarezMemberI 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.
September 10, 2013 at 5:24 pm #61810derekalvarezMemberI 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(); ?>
September 25, 2014 at 9:43 pm #125762morktronMemberHi 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(); ?>
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.