• Hi

    I am developing my first WP Theme and facing problem with Sidebar.

    I’ve enabled two sidebars (1. First Sidebar & 2. Footer Sidebar) in WP Admin>Appearance>Sidebar. But when I add any widget in any of these sidebar it don’t reflect in my site.

    Here is the code I’ve written so far.

    Sidebar.php

    <?php
    
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    ?>
    <div id="sidebars" class="sidebar">
        <div id="sidebar-1">
            &nbsp;test
        </div>
    
        <div id="sidebar-2">
            Footer Sidebar
        </div>
    </div>

    functions.php

    <?php
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    ?>
    <?php
    /*Registering Right Sidebar*/
    if(function_exists('register_sidebar')){
            register_sidebar(array(
                'before_widget'=>'<div id=%1$s" class="widget %2$s>',
                'after_widget'=>'</div>',
                'before_title'=>'<h2 class="widget_title">',
                'after_title'=>'</h2>',
                'name'=>__('First Sidebar'),
                'id'=>__('sidebar-1')
            ));
    
            register_sidebar(array(
                'before_widget'=>'<div id=%1$s" class="widget %2$s>',
                'after_widget'=>'</div>',
                'before_title'=>'<h2 class="widget_title">',
                'after_title'=>'</h2>',
                'name'=>__('Footer Sidebar'),
                'id'=>__('sidebar-2')
            ));
        }

    I think I’ve missed something. Please help.

    Thanks in Advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Sidebar not responding’ is closed to new replies.