Build a Plugin (Twitter Widget) into your WordPress Theme
WPCandy talked about building a functionality plugin which is to take functions that could be added to your theme’s functions.php file and making a plugin out of them so if you change themes you won’t lose any essential functionality ( like shortcodes etc).
But what if you want to do the opposite and take a plugin’s functionality and build it directly into your theme? That’s the subject of this quick guide – I will show you how to take a Twitter widget plugin and make it part of your theme.
The Plugin File
The plugin we will be using is DP Twitter Widget, what this plugin does is add a new widget which you can display your tweets live on your site. Download the plugin and unzip the file. Inside the zip you will see several files, the one we need is called dp-twitter-widget.php. Within your theme directory, create a new folder and call it “widgets” and upload this file to there.
Now open your theme’s functions.php file and add the following line to it to call the plugin file :
Save your functions.php file and upload.
Now within your WordPress admin panel, visit “Appearance” > “Widgets” and you should see an extra widget has been added :