WEB170 » Using Widgets in Your WordPress Site
WordPress Widgets add content and features to your Sidebars. Some WordPress Widgets offer customization and options such as forms to fill out, includes or excludes of data and information, optional images, and other customization features. Plugins will often add their own widgets.
Step One: Register Your Sidebars
If you are looking for Widgets in your Admin and cannot find them, there is a good reason. You haven’t registered any yet.
So let’s use the Register Sidebar function in our functions.php file:
You can use whatever parameters you’d like to. I am going to keep mine pretty basic for now.
See Also: https://codex.wordpress.org/Function_Reference/register_sidebar
Once we have registered our sidebar, we should see a whole list of widgets by going to Appearance > Widgets:
Step Two: Add a Widget to Your Sidebar
Now that I can see all of my widgets, I am going to add one to my sidebar
If I choose a widget, I can see that I can add the widget to my sidebar:
Once I do this, I should see the widget in my sidebar:
Step Three: Call the Dynamic Sidebar
Lastly, we need to tell this sidebar where to show up in our website.
We need to add the Dynamic Sidebar function to our sidbear.php file:
See Also: https://codex.wordpress.org/Function_Reference/dynamic_sidebar
Once we do this, we should see our widgets in our sidebar:
This portion of the Premium Design Works website is written by Mike Sinkula for the Web Design & Development students at Seattle Central College and the Human Centered Design & Engineering students at the University of Washington.
Social