Adding single widgets in wordpress

Many of the times, we saw that we are not able to do some very easy tasks. One of them is “Adding widgets in wordpress”. In this tutorial, I will show you how to “Add widgets in wordpress”.

Follow these steps:

Step1:

Open your function.php file and then copy and paste the following code in that file:

Step 2:

Now Go to the admin section of your wordpress website and then go to Appearance/ widgets. There you will see the widget title with name “footer”. This was the name given in the code as ‘name’ => ‘footer’.

Step 3:

Now drag and drop the widgets you want to add to your widget area.

Step 4:

Now your widget is set. Its time to use those widgets in your page. To do so you have to open that page in which you want to show the widget. Generally, we add widgets to the sidebar or in the footer. In this tutorial, I am adding widget to the footer so I will open thefooter.php file and then add the following code to it.

Note: Here ‘search’ is the id given in the code in function.php file as ‘id’ => ‘search’

Now your page is ready with your widget.