What are widgets exactly, you ask?
They are modular tools in WordPress that developers can use to make adding/editing content by users EASY! And, all users LOVE easy, right?
In WordPress (and other Web Content Managements Systems), widgets live in static elements (namely header areas, sidebars & footer areas) that persist throughout the site without having to code/place them over and over again, which means less work for website developers & owners. Sounds good? Ok, let’s get started!
(NOTE: some readers may be familiar with widgets as they appear on smartphones, tablets, and even desktops – the concept in web design, while similar, has a few key differences).
Firstly, there are many different types of widgets, some allow just text/html, some are rss feed or blog-roll displays, some allow slideshows, & others yet are creative jQuery scripts that animate photos with layover text for example – the possibilities are nearly limitless!
Where do you typically find widgets? Nearly every WordPress & Drupal site uses widgets, most major websites on the planet use a variety of widget – again, remember these are elements that remain consistent throughout a site independent of page changes.
Widgets are one of the most versatile tools that you can use to display content to your site visitors, they are easy to change/manipulate and you can ‘hot-swap’ just by clicking and dragging! WordPress even has a storage area for configured widgets that you wish to put aside temporarily without losing the content inside them.
There are several widgets on the right side of this page in fact! But can they only be used in sidebars? Nope!
Widgets on Pages is a WordPress plugin that allows self-hosted WordPress sites to define and place widgets in templates, pages and posts. You can find the plugin here or by clicking on the image above. Once you install it on your WordPress site, you can configured it by going to the Plugins page from the left sidebar and then click on ‘Settings’ on the Widgets on Pages Plugin.
Create one or more sidebars and then head to Applications/Widgets to create your widget’s content. The plugin uses shortcodes to place WoPs on pages/posts. These shortcodes take on the following format [widgets_on_pages id=”widget_name”] – replace widget_name with whatever your widget is called!
You can also use widgets created with a WordPress Plugin in php template files with the following php code:
Feel free to reach out if you have questions – you can write me here: firstname.lastname@example.org