WordPress sidebar/widgets


  1. Add the following code into function.php
    function ourWidgetsInit() {
     register_sidebar(
      'name'=>'Sidebar',
      'id' => 'sidebar1'
     ));
    }
    add_action('widgets_init', 'ourWidgetsInit');
  2. Add the following code into your template file(front end)
    <?php dynamic_sidebar('sidebar1'); ?>

Labels: , ,

© copyright-2020 Rejaul