New Landing How can we help? Themeforest Theme Support Dante How to Call Sidebar to Template – Need PHP Info

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Dante
  • #94309
    FNFWeb
    Member
    Post count: 27

    Hello,

    I’m working with the Events Calendar Plugin from Tribe. Every time I use it, I swear it’ll be the last time, because the pages are automatically generated with no shortcode support and things like this are without fail, a nightmare. Alas, I have to work with it again on this project and it’s killing me.

    I need to call the a sidebar into their default template. This is what their template code looks like:

    if ( !defined('ABSPATH') ) { die('-1'); }
    
    get_header(); ?>
    <div id="tribe-events-pg-template">
    	<?php tribe_events_before_html(); ?>
    	<?php tribe_get_view(); ?>
    	<?php tribe_events_after_html(); ?>
    </div> 
    <?php get_footer(); ?>
    

    Ideally, it would be the right hand sidebar and I could specify which number widget area, but I’d settle for whatever the default display is. I know that you don’t support 3rd party plugins, but essentially what I’m looking for is just how to call a sidebar into a template. I’ve been looking through the code in the theme files and it’s beyond me.

    Thank you,

    Kait

    #94445
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You insert this code $sidebar_config = “right-sidebar”; after get_header(); so final code will be :

    if ( !defined('ABSPATH') ) { die('-1'); }
    get_header();
    $sidebar_config = "right-sidebar";
    ?>
    <div id="tribe-events-pg-template">
    	<?php tribe_events_before_html(); ?>
    	<?php tribe_get_view(); ?>
    	<?php tribe_events_after_html(); ?>
    </div> 
    <?php get_footer(); ?>

    Hope that should work and let me know your feedback.
    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #94539
    FNFWeb
    Member
    Post count: 27

    Thank you, though that’s not working. The sidebar is still nowhere to be found :/

    Doesn’t there need to be a div around it?

    #94578
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this code :

    <aside class="sidebar right-sidebar col-sm-4">
    <?php dynamic_sidebar($right_sidebar); ?>
    </aside>

    So final code will be

    if ( !defined('ABSPATH') ) { die('-1'); }
    get_header();
    $sidebar_config = "right-sidebar";
    ?>
    <div id="tribe-events-pg-template">
        <?php tribe_events_before_html(); ?>
        <?php tribe_get_view(); ?>
        <?php tribe_events_after_html(); ?>
    </div> 
    <aside class="sidebar right-sidebar col-sm-4">
     <?php dynamic_sidebar($sidebar_config); ?>
    </aside>
    <?php get_footer(); ?>

    Thanks

    #95014
    FNFWeb
    Member
    Post count: 27

    That didn’t work either, but I found another way around it. Thank you for trying!

    #95044
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I am glad that you managed to resolve the issue.
    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register