I want to register_widget that has functioned like a sidebar, can drag many widget. I see it before, used with one plugin but I forgot it. Please see the screenshot for reference.
Leave a Reply
You must be logged in to post a comment.
I want to register_widget that has functioned like a sidebar, can drag many widget. I see it before, used with one plugin but I forgot it. Please see the screenshot for reference.
You must be logged in to post a comment.
(1) If you want to create a widget area, do this:
Add the following code to the functions file, making sure you place it in between php tags:
Give the widget area a name â e.g. my_new_widget and in the before/after options you can place code which you wish to appear wrapped around either the widget itself or the title.
Then go to the area in your them where you want the widget to be displayed (in your header.php, index.php, single.php, etc.), and do this:
In your WordPress themes editor open the header.php file.
Find the location where you want to place the menu and add the following code to the header.php file:
Then when you go to your dashboard, you will see a new widget area in Appearances >> Widgets.
Here’s another way to create a new widget area.
(2) If you’re talking about creating a new sidebar:
Youâll want to begin by finding any existing âregister_sidebarâ entries in your functions.php file. Some of mine have the following existing sidebar definition for the single default sidebar:
To register your second sidebar, we simply add the following code to the functions.php file:
So basically, you just:
If you upload your new functions.php file to your WordPress installation, you should see your new sidebar if you browse from your WordPress dashboard to Appearance, then Widgets.