Even though there are a lot of quality WordPress widgets available, sometimes you will find that no single one fits your exact requirements. In such a case, you'll have to create your very own widget. It may sound difficult at first, but if you have any programming experience it is very easy.
To create your very own widget, you need nothing but a text editor. Start by creating a directory on your hard drive that will contain the widget file(s). In this example, I have called this directory test
.
In the
test
directory, create a file namedtest.php
.Edit the
test.php
file and paste the following code, which tells WordPress that this file is a widget:<?php /* Plugin Name: Test Plugin URI: http://www.yourblog.com Description: Testing custom widgets Author: You! Version: 1 Author URI: http://www.yourblog.com */
Now, we have to create the function that will be displayed when your widget will be added to a widget...