• Blog

    Latest from our Blog

  • Tools

    Our Favourite WP Tools

  • Hosting

    Recommended Web Hosts

  • Coupons

    Get great money off deals

  • Themes

    WordPress Theme Directory

  • Plugins

    WordPress Plugins Directory

  • Promote

    Your WordPress Product

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.

Theme Functions.php

Now open your theme’s functions.php file and add the following line to it to call the plugin file :

require_once('widgets/dp-twitter-widget.php');

Save your functions.php file and upload.

The Widget

Now within your WordPress admin panel, visit “Appearance” > “Widgets” and you should see an extra widget has been added :


Post Tags

Author:

Oliver Dale is the founder of Kooc Media, a small internet company based in the UK. Kooc Media runs several high-profile websites including WPLift, ThemeFurnace and DesignersTalk.

Leave Yours +

7 Comments

  1. Lily

    I had follow all your steps, but what had happened is that I cannot access my blog.
    Warning: require_once(widgets/dp-twitter-widget.php) [function.require-once]: failed to open stream: No such file or directory in /home/username/public_html/wp-includes/functions.php on line 3699

    Fatal error: require_once() [function.require]: Failed opening required ‘widgets/dp-twitter-widget.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/username/public_html/wp-includes/functions.php on line 3699

    help!

    • lily

      i uploaded db-twitter-widget.php into public_html/wp-content/themes/europe/widgets. Is this correct? Then I copied the code into functions.php at the bottom of the script. Do i need to upload the plugin zip into wp-includes/plugins? I lost my blog. Help!

  2. When I activate the plugin, it turns all of my links links white in the admin screen. Also, how can we display the date/time of the tweet?Thanks.

Leave a Reply

* Required Fields.
Your email will not be published.

Search

Our Sponsors