Add custom widgets to your WordPress theme

Learn how to add custom widgets to your WordPress theme by following the simple steps below. This tutorial will require you to copy & paste a few lines of code into your WordPress theme files to setup your custom widgets in WordPress.

Setup your widget

To setup your custom WordPress widget simply add the following PHP code to your functions.php file located in your theme folder. You can give your widget a name, in this example we are calling it ‘Widget One’.

Editing your widget

You can edit your widget by navigating to Appearance > Widgets. On the widgets page, you should see your custom widget ready to use!

Displaying your widget

To Display your widget simply add the following line of PHP code to the destination you wish to display your widget.  This can be in your header.php, footer.php,index.php or anywhere you wish.

Creating multiple widgets

Creating multiple widgets for your WordPress theme is easy, simply follow the process above but change the name from ‘Widget One’ to your desired name for your new widget.

Glenn Smith

© 2017, All Rights Reserved - Glenn Smith