Registring widget area and how to use it later


To register a widget area for you theme you should  use the register_sidebar function in your theme’s function.php.

This function will register the widget’s area through the ‘widgets_init’ hook.

For more specification on register_sidebar please see here.

Next step is to set the place where we want to see the widgets to be displayed. Put the following code in your html code where you want to have to widget’s block to appear.

Now you can go to your admin panel Appearance – >Widgets and navigate through your new widget area.

 

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *