Many WordPress users have been finding that a large number of the plugins they have tried to install in their sidebars lately aren’t working. In most cases, this is purely because your theme is widgetized.

Widgets were originally a plugin that allowed you to easily edit your sidebar content. As of version 2.2 of WordPress, it comes as default. Widgets can be very useful, but they have caused some people some trouble. Thankfully, there is an easy solution.

The Problem With Widgets

The problem is that some people forget about widgets when they add their plugins.

Have a look at your sidebar.php file. You will find that it resembles the following:

<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
// Normal sidebar content here.<?php endif; ?>What this means is that if your version of WordPress is widget-enabled, everything between those PHP tags will be ignored.

It is of course possible to get your plugins to work by simply placing the plugin code outside of these tags. The problem is that this means your plugin must be at either the top or bottom of the sidebar. It cannot be in the middle.

The Solution

The simple solution comes in the form of a plugin from Otto Destruct, called ExecPHP. After installing ExecPHP (Same installation as any other WordPress plugin), you will have the option to add “PHP Code” widgets on your widget page. These widgets, unlike the default text widgets, can take PHP code, so to install your plugin, just paste the code into one of Otto’s PHP widgets!

Simple, painless solution, which can be seen in action on Pro Blog Design.

widgets

What do you think of widgets? Are they useful?

Enjoy this post? You should follow me on Twitter!