• Resolved Vipasha

    (@vipasha)


    Hello! News Portal Theme Team,

    I want to add Banner Slider for Featured Posts in my Review Blog https://day-technology.com/. I try to add Banner Widget with following Code, But nothing happen. Please help me in this.

    Banner Widget Code:
    // Banner Widget Start

    function wpb_widgets_init() {

    register_sidebar( array(
    ‘name’ => ‘Banner Widget’,
    ‘id’ => ‘custom-header-widget’,
    ‘before_widget’ => ‘<div class=”chw-widget”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h2 class=”chw-title”>’,
    ‘after_title’ => ‘</h2>’,
    ) );

    }
    add_action( ‘widgets_init’, ‘wpb_widgets_init’ ); // Banner Widget End

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Mystery Themes

    (@mysterythemes)

    Hello there,

    While we are testing it’s fine for us.

    function wpb_widgets_init() {
    
    register_sidebar( array(
    'name' => 'Banner Widget',
    'id' => 'custom-header-widget',
    'before_widget' => '<div class="chw-widget">',
    'after_widget' => '</div>',
    'before_title' => '<h2 class="chw-title">',
    'after_title' => '</h2>',
    ) );
    
    }
    add_action( 'widgets_init', 'wpb_widgets_init' ); // Banner Widget End

    Thanks,

    Thread Starter Vipasha

    (@vipasha)

    Thanks for your reply… But this code is showing nothing… What to do?

    Thread Starter Vipasha

    (@vipasha)

    Problem solved….

    I forgot to add below code in header.php

    <?php

    if ( is_active_sidebar( ‘custom-header-widget’ ) ) : ?>
    <div id=”header-widget-area” class=”chw-widget-area widget-area” role=”complementary”>
    <?php dynamic_sidebar( ‘custom-header-widget’ ); ?>
    </div>

    <?php endif; ?>

    Thanks for your help

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need Banner Slider for Featured Posts’ is closed to new replies.