dynamic_sidebar not Showing on page

I was trying to add the Sidebar by adding this code to the Functions.php of theme

if(function_exists('register_sidebar')) {
 register_sidebar(array(
        'name' => __('Company Single Sidebar', 'responsive'),
        'description' => __('Area 12 - company-singlesidebar.php', 'responsive'),
        'id' => 'company-singlesidebar',
        'before_title' => '<div class="widget-title">',
        'after_title' => '</div>',
        'before_widget' => '<div id="%1$s" class="%2$s">',
        'after_widget' => '</div>'
    ));
}

And after that i add this code to the template page.

Read More
        <div class="contant_right_wrap">
          <?php dynamic_sidebar('company-singlesidebar');?>
        </div>

The Sidebar is shown in the Widget but not showing on the Page.

Related posts

Leave a Reply

1 comment

  1. Just a few tips here:

    • You don’t need to wrap your sidebar registration in a if(function_exists()) conditional statement. register_sidebar is a core function, so it will always exists.

    • When registering a sidebar, it is always good practice to do it inside a function and then hooking that function to the widgets_init hook

    Apart from that, your code should work