WordPress.org

Ready to get started?Download WordPress

Forums

BlogoLife
Blogolife - How to add a custom sidebar to a page (2 posts)

  1. terrytek
    Member
    Posted 11 months ago #

    I have registered a custom sidebar in my functions.php file, but cannot get it to show on the appropriate page. I suspect this has something to do with the 'wpl_enable_sidebar' function, which I can't locate. Where is it in the theme files?

    Thank you.

  2. victortihai
    Member
    Posted 11 months ago #

    Hi,

    1. Edit the /functions/fe/widget-init.php and register a new sidebar here.

    2. Add a new file for ex: sidebar-NAME.php

    3. Add the next content in the file:
    <div id="secondary" class="widget-area" role="complementary">
    <?php do_action( 'before_sidebar' ); ?>
    <?php if ( ! dynamic_sidebar( 'sidebar-XXXXXXXXXXXX' ) ) : ?>
    <?php endif; // end sidebar widget area ?>
    </div>

    4. To include sidebar in the page use <?php get_sidebar('NAME'); ?>

Reply

You must log in to post.

About this Theme

About this Topic