Give your page wings: the WordPress Side Content Plugin
Friday, July 4th, 2008I wrote this plugin to provide similar functionality to the Drupal Side Content module. It makes it easy to have unique sidebar content on any page. Yes, it gives your page wings - or its own widgets, anyway.
If you see any PHP errors on activating the plugin then the most likely cause is that you are using PHP 4. This plugin requires PHP 5.
You can see it in action on our starter site package page. The three blocks in the righthand sidebar belong to this page and only appear on it. (Our custom theme uses the API functions that come with the plugin to detect the widgets are there and show them in an extra wide sidebar.)
Here’s how to use it:
- Install and activate the plugin in the normal way.
- On the settings page for Side Content, enter the names for your widgets, one per line. (These will also be the names of your custom fields). Save your changes.
- On the Design->Widgets page, you’ll now see your widgets listed and you’ll be able to position them as you like in your sidebar(s).
- Edit a page (or post) for which you want one or more sidebar content widgets. The widget entry areas will be found in a sub panel headed “Side Content Widgets”. In each area enter the HTML (including any heading) you wish to appear. The widget content will be saved along with the rest of the page or post.
- Tip: use the HTML editor for the page to create content for a field, then (in HTML mode) cut and paste it into the custom field value area.
- Note: it now works with both pages and blog posts.
- Note: as of release 0.7 the plugin includes support for the new WordPress shortcode API.
- Note: as of release 0.6 the plugin is compatible with WordPress-MU.
- Note: as of release 0.5 it has its own subpanel on the edit page.
Although the plugin does not require any theme changes to be made, it does provide a useful API function that can be used in templates to adjust page layout if required. To call it, code as follows:
if(function_exists('the_side_content')) {
if(the_side_content()->has_widgets()) {
// template adjustments for side content widgets
}
// alternatively, you can test for a particular widget by name
if(the_side_content()->has_widgets('mywidget')) {
// template adjustments for side content widget 'mywidget'
}
}
Note that this plugin requires PHP5. Compatible with WP 2.5 through 2.7.
Sign up to our newsletter for great WordPress and Drupal tips.








July 9th, 2008 at 2:47 pm
hi. Thanks for plugin
perfect.
Regards
July 16th, 2008 at 11:56 pm
Sounds brilliant!
Thank you! No more messing about with multiple sidebars!
July 17th, 2008 at 9:15 am
Thanks! Feel free to rate the plugin on wordpress.org: http://wordpress.org/extend/plugins/side-content/
July 18th, 2008 at 2:44 am
I’m going to install this tonight. Just what I was hoping WordPress would do themselves in an update. Great work.
July 19th, 2008 at 4:10 pm
very nice plugin indeed, hope it will include the posts too a day !
I just have had a little problem with the doublequote (”) as they were escaped in the custom field when saved (\”). I used single ones (’) instead and it did work properly
July 19th, 2008 at 4:21 pm
Olivier - I wonder how that happens. I suspect I’m missing one of wordpress’s magical calls that copes with all the different combinations of server variable set ups.
The change to include posts is easy, so I’ll probably add it as an option in the next release.
July 25th, 2008 at 10:58 am
This is a great plugin
July 31st, 2008 at 12:38 pm
Love the concept but afaird I just dont get it. I desparately want to have different widgets in the side bar of each page of my site.
I followed the first steps and can see the
“Side content widget: Stock Quote Sidebar” on the design, widgets page.
But I dont get where to go from here? Everything I “add” would still appear on all pages?
I’m not sure where exactly to enter the code (or what exactly is the code)
Thanks for you help.
July 31st, 2008 at 1:15 pm
Ryan, so far you’ve created an empty widget. You can position it on the design widgets page, but nothing will actually appear until you give it some content.
The way you give it content is as follows: edit a page or post then scroll down the page until you see the custom fields section. Click on it to open it.
Ignore the pulldown on the left for now. In the key box enter the name of your widget EXACTLY as on the configuration page; in the value box enter the HTML you want for the widget content. Press ‘add’. (If there are quotes in the HTML you may find they’ve got \ characters in front - this is a wp 2.6 bug. In that case re-edit the html and press update for the field and all will be well.)
Now save the page or post, and when you view it you should see the side content widget you defined, only on that page. Repeat for each post or page as required.
One day I hope to have time to spend making the plugin a little easier to use, but don’t hold your breath!
August 11th, 2008 at 11:22 am
Looks like a great plugin - just what I am looking for, except I get an error…
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /mnt/local/home/directory/example.com/wordpress/wp-content/plugins/side-content/side-content.php on line 18
August 11th, 2008 at 3:05 pm
Thanks for your help Alfred. I’ve upgraded from PHP 4.4 to 5.2 and the plugin is now working.
Many thanks!
September 30th, 2008 at 2:39 pm
Hi, great plugin. I am using it with only 2 issues and not sure if you can help. I am displaying a side nav using ul and li tags - my links a href=”" etc etc, are always saving with backslashes =\”/link/”\. Ive used the HTML editor as you suggested. After removing the unnecessary slashes and saving the page again it works. Any idea why this is happening?
Second thing is, any idea how to make the “value” input field bigger as the side content is quite long and hard to edit in the small input box. I suspect this is editing the actual WP page - did you have to do this, or attempt to do this?
Thx
Rob
September 30th, 2008 at 2:50 pm
Rob, thanks for the comment and glad you like the plugin. The slashes
issue is a WP bug, I’m afraid.
Regarding your other question, in a future version I mean to give the plugin its own edit area which should make life easier for anyone dealing with large chunks of HTML.
Edit: From release 0.5 the new edit area has been added and the slashes error is no longer a problem.
September 30th, 2008 at 5:22 pm
Here’s a quick fix for the small boxes problem reported by Rob. Add the following to wp-admin.css:
#postcustomstuff textarea {
height:200px; /* adjust to suit your needs */
}
Edit: with the latest release the plugin has its own panel with larger input areas.
October 4th, 2008 at 1:25 am
I like the ideal of being able to add content. I follow the directions I think but got a weird looking layout on my widget screen after I put html in the same box that I named. Do you have simpler step by step instructions available for this plugin? I would really appreciate it! Thanks,
Dee
October 16th, 2008 at 4:37 am
Hello,
I wonder how can I add content to a widget using th API. I would loike to add the code in my template files. I know how to check if it has widgets or not, but I do not know how to set the content of the widget.
Can you help me?
Thanks in advance,
Will
October 16th, 2008 at 12:54 pm
Hey,
I just want to let everyone know that I got a ultra-fast and very helpful reply via email to my previous question so I want to thanks Alfred for his plugin, his blog and now also for his support. Way to go!
All best,
Will
October 26th, 2008 at 11:09 pm
Great except
I can not get the post or page to save more than 1 widget (the last one) the others do not get saved.
is this somehting obvious I am missing.
October 27th, 2008 at 3:58 pm
Dear Alfred,
I am getting this error code when I try to activate the plug-in, can you help?
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /mnt/local/home/directory/example.com/wordpress/wp-content/plugins/side-content/side-content.php on line 18
Thank You.
October 27th, 2008 at 11:03 pm
I was looking forward to this plugin. However, it does not seem compatible with the Multi-User version of WordPress.
http://mu.wordpress.org
When I submit the names of the widgets in the Settings area, it shows me the “try again” screen.
October 28th, 2008 at 7:14 pm
I would love to use this plugin with my my WP MU. It’s an awesome idea and is very helpful.
But when I try to add my widget lines it says: Are you sure you want to do this? Try again!
Can you please help?
Thank you so so much.
Vida
November 1st, 2008 at 7:49 pm
My side content widgets appear on my Widgets page, but when saving a post the side content doesn’t save, whether entered in the drop down box nor as a custom field. After saving it just disappears and the drop down box has closed and is empty. Any ideas? Thanks!
November 3rd, 2008 at 1:53 am
Hi Alfred,
I’m getting the same error when activating in WP v263:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /var/www/vhosts/example.com/httpdocs/wp-content/plugins/side-content/side-content.php on line 18
Line 18 Code:
private $widgets = array();
Thanks for any help you can provide, and great work with this plugin — It’s a life saver, from one sidebar hardcode-er to another!
November 3rd, 2008 at 11:01 am
Josh, the PHP error is due to you running under PHP4. Please note that PHP4 is not supported.
November 9th, 2008 at 6:25 am
Hi, i really want this plugin to work… but when i go to settings -> side content
and enter the name of the widgets .. on clicking save i get the following error:
“Are you sure you want to do this?
Please try again.”
Even if i try again ..the contents are not getting saved …any suggestions would really help
November 9th, 2008 at 8:00 pm
For Nirav and others using WordPress MU, the latest release includes the necessary magic code required for MU compatibility.
November 23rd, 2008 at 7:20 pm
Very Nice plugin perfect for me thanx
December 4th, 2008 at 4:30 am
Hi Alfred,
Just what I’ve been looking for to use on school site I’m working on. I’m using WP 2.6.5. The template I’m using is widget ready and is already using a couple successfully.
I’ve installed the side-content widget, activated it, made a widget title in the settings panel, added the widget to the sidebar in Design / Widgets - all without problems.
However, like Tim above, even though I’ve entered some content in the Side Content field of a page and saved it (the page was an existing one), the side content widget is not displayed.
I can’t see a response to Tim, so thought I’d give you another go.
Thanks for your help in advance.
Cheers, Tracy
December 4th, 2008 at 4:37 am
Hi,
I should add that, like Tim, the content is not saved in the side content field after I press save.
The field is not showing in the custom fields section.
Cheers,
Tracy
December 4th, 2008 at 10:15 am
Tracy, the latest version of Side Content should fix the problem, I think.
December 10th, 2008 at 12:00 pm
This is a great plugin
December 11th, 2008 at 12:47 am
Great plugin.
Will it be updated for 2.7, I do not think it works out of box with 2.7 RC2.
December 11th, 2008 at 10:12 am
Pat, I’ll update the plugin as needed once 2.7 is released.
December 11th, 2008 at 9:01 pm
This is a great plugin. Exactly what I’ve wanted. Just looking for some help. How can use it to pull an RSS feed? For our bio page, I want to have it pull the 5 most recent posts from blog of the staff person whose who is being displayed. Does that make sense?
In short, what would be the call to display an RSS feed in this side content widget?
December 15th, 2008 at 3:25 pm
Thanks Alfred and look forward to the updates.
You will know that 2.7 official does not allow your plugin to be activated.
There are some other widget plugins, but none are as easy to effectively manage as your one.
Steve you could use javascript or php to show rss feeds. You will need to do some research on what is best for you, maybe look up magpie.
But I think Alfreds plugin is the best way to organise the show.
December 18th, 2008 at 6:36 pm
This will help me a lot
December 21st, 2008 at 3:50 pm
As of today there’s a new release which works with WordPress 2.7.
December 23rd, 2008 at 2:48 am
Have not tried it yet, if it works as before then it is the one of best plugins around.
Wanted to say thanks Alfred for the work and a very happy Christmas and new year to you and yours.
December 23rd, 2008 at 11:59 am
Thanks Pat. All the best to you and anyone else reading this.
December 31st, 2008 at 9:27 pm
Working perfect with wp2.7
thankyou Alfred
happy new year…
January 2nd, 2009 at 1:42 pm
I just installed version 0.8 of this plugin in WP 2.7 and the 2 add-ons (NextGEN and qTranslate) are flagged as needing an upgrade from v 0.1 to 0.8. Can you please fix this in the released version? thanks
January 3rd, 2009 at 4:37 pm
Alfred, Your plugin accepts and works great with html! is it possible to parse php. or maybe point me to how I could adapt it to do so.
Aim-
I would like one widget to show rss feeds, but differet ones on different pages and posts.
Thanks
January 8th, 2009 at 8:06 am
Awesome Awesome Awesome. I’ve been through every widget changer out there for my 2.7 site and none of them worked. I’m not much of a programmer and just needed something to display different info for each page. You made it happen. I’ve been at this for hours now and I can finally get to work. thank you thank you thank you.
January 8th, 2009 at 10:16 am
Glad to be of service, Chip!
January 9th, 2009 at 2:42 pm
Hi Alfred,
Nice plugin, and I have got it working. But how do you exclude all the standard wordpress widgets from a page? I made a contact page, and the created contact widget sits nicely on top of the sidebar (and doesn’t show up anywhere else). But all the other widgets that are default in my design, e.g. categories, blogroll etc. are listed below. How to remove them from the contact page?
January 9th, 2009 at 3:02 pm
Jesper, there’s a great plugin called Widget Logic which solves this problem: http://wordpress.org/extend/plugins/widget-logic/. You’ll need to code some very simple PHP to make it work but the examples are helpful.
January 9th, 2009 at 3:12 pm
Thanks! Tested and works!
January 11th, 2009 at 2:12 pm
I have used in on a WP 2.6 installtion, and it worked really well (thanks for this solution). I’ve just upgarded to WP 2.7 latest release, but now I’m unable to add new items. I imagine this is due to the WP 2.7 upgrade. Will you be making a release for the latest WP versions? best regards.
February 7th, 2009 at 1:29 pm
Two questions:
1. How to make it work with qtranslate? I switched between languages and the side content kept the same content.
2. How can I remove the rest of widgets from the side bar and keep only side content for that specific page?
Thanks for the work!
February 8th, 2009 at 1:02 pm
Thanks a lot for sharing this plugin.i love it’s functionality.
have a good day
February 10th, 2009 at 8:26 am
This is the one that I’ve been looking for… Thanks!

But it can’t exec PHP code
It would be nice if you could make it so that it could exec PHP code like the ExecPHP plugins…
Anyway… great plugins!
February 18th, 2009 at 4:03 pm
This plugin is great. Thank you.
If it was possible to run PHP it would make it perfect.
Thank a lot
February 18th, 2009 at 4:12 pm
I’ve now had a couple of requests to make the plugin execute PHP, but my feeling is that if that’s what you think you need, you are probably after a different plugin, and chances are it’s Widget Logic.
http://wordpress.org/extend/plugins/widget-logic/
Having potentially different PHP scripts on every post is a maintenance nightmare and in my view a Very Bad Idea.
February 19th, 2009 at 6:20 am
This is almost exactly what I want, but I want different content for category pages, not individual posts and pages. Is there a way for this to work for me?
February 25th, 2009 at 10:43 am
Ajax movable and WYSIWYG-editor would kill.
March 4th, 2009 at 10:30 am
Is there any reason why this widget would not allow a libghtbox effect to work? I’ve placed different next-gen galleries in different pages and the effect isn’t working…. can let you have the url (privately) if you wish as it’s in a testing environment and not fully operational yet. Cheers
March 4th, 2009 at 11:15 am
Pete, I took a look at your page and it would seem to be the theme at fault: no javascript being loaded.
March 10th, 2009 at 1:57 am
Doesn’t work on WP2.7.1, but tanks anyway
March 10th, 2009 at 2:38 am
Wooww, Side Content 0.8 yes works in WP2.7.1 !!!
March 10th, 2009 at 12:30 pm
Hi,
The plugin looks very useful!! thanx!! Just one question, it cant remove the sidebar completely from certain pages can it??
If not, do you know what I could use for this?
Thanks
March 10th, 2009 at 6:15 pm
Jarvis88, it’s not suited to that problem: usually I’d solve it by creating an alternative page template. See http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates for more details on how to do this.
March 23rd, 2009 at 10:28 pm
I’m excited to get this plugin to work. I think it is exactly what I am looking for. However I am new to WordPress and can’t seem to figure out how to get it to work.
I have activated the plug-in. It appears on my “available widgets” list but for some reason the name of the widget is blank and only the description “Side content widget:” appears. Is that normal?
I added the custom field at the bottom of my page, but I am confused as to what the “value” is supposed to be. Also, can I designate which side the content appears on? Thanks for helping out a “newbie”
April 28th, 2009 at 7:44 pm
[...] hatte zunächst noch das PlugIn Side Content installiert. Über dieses PlugIn kann man Boxen erzeugen, die dann im Bearbeitungsmodus direkt [...]
May 1st, 2009 at 10:08 pm
Great and very usefull plugin! Thank you!!!
May 2nd, 2009 at 5:43 am
[...] Side Content Plugin [...]
May 7th, 2009 at 3:21 pm
Hi Alfred,
great plugin. Ive emailed you a few times about it and thanks for the support. Just a question to get your thoughts as I have a need for a new site and want to use your plugin. The issue is I have a sidebar using your plugin being shared on 3 pages of the site. If the sidebar content is updated, it must be updated on all 3 pages, something I want the site owner to avoid doing. can you see anyway so that if the sidebar content on one page was updated it would automatically be updated on all 3 pages? Can you see anyway to get this work?
Thanks
Rob
May 27th, 2009 at 2:05 am
hi alfred,
i guess i have php 4, b/c i received the fatal error when activating plug message. i guess my question is, how to do i update to php5? and will this mess up my other sites?
thanks,
michael
June 5th, 2009 at 1:00 am
[...] Go to Source [...]
June 15th, 2009 at 5:03 pm
Hi, I just downloaded and installed your plugin but it does not seem to be working correctly on WP 2.8. On the Edit Post page, the widget textboxes are there, but there’s nothing in the right column next to them– I didn’t even know there was supposed to be anything there until I saw your 7/31/08 comment above. Any idea how to get this to work, or do you plan to update it to work with 2.8?
Thanks,
Aaron
June 17th, 2009 at 4:41 pm
This is a great plugin thank you so much.
It worked perfect.
June 17th, 2009 at 10:20 pm
Does Side Content work with Word Press 2.7 or 2.8. I have tried the plugin in both versions but everytime I add the custom field and save the post the custom field disappears. Any other custom field I enter works and saves with no problem.