How to create a widget area in wordpress theme

How to enable widget area in wordpress theme

Custom widget area is enabled from function.php that is available in the themes folder.
Add the following code in function.php to enable/register widget area in the wordpress theme:

How to add widget area in wordpress theme

Once you have enabled the function in function.php you can make any area as a widget area within a wordpress theme. Add the following code to the area ( sidebar, footer, header ) where you want the widget to to make a slot and add widget to it later from widgets setting panel:

NOTE: If you want more then one area to be widgetized at the same time, then you have to register sidebar in function.php more then once with different names and id’s

Now that you have enabled the widget area as well as created a slot for the widgets to be placed in, you can go to Appearance -> Widgets in admin panel and add the widgets to the slot you have just created.

[Total: 1    Average: 5/5]

Share on Facebook0Pin on Pinterest0Share on Google+0Share on LinkedIn0Tweet about this on TwitterEmail this to someone
The following two tabs change content below.
Chris

Chris

Hi, I'm a software developer, Chris from Sydney NSW Australia.
Chris

Author: Chris

Hi, I’m a software developer, Chris from Sydney NSW Australia.