980px

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:

Register My Sidebar

Register My Sidebar

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:

Widgets!

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:

Add Widget

Add Widget

Once I do this, I should see the widget in my sidebar:

Widget in Sedebar 1

Widget in Sedebar 1

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:

Call Our Widgets

Call Our Widgets

See Also: https://codex.wordpress.org/Function_Reference/dynamic_sidebar

Once we do this, we should see our widgets in our sidebar:

Widgets in My Sidebar!

Widgets in My 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.

Leave a Comment:

Don't forget to get your Globally Recognized Avatar.

css.php