Technology Blog »

Give your page wings: the WordPress Side Content Plugin

I 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.

Update 15 November 2009: Since our latest redesign this site no longer uses the Side Content plugin. If you are using it, I’d very much appreciate links that I can post here to illustrate this article.

Download the plugin.

Here’s how to use it:

  1. Install and activate the plugin in the normal way.
  2. 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.
  3. 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).
  4. 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.
  5. 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.
  6. Note: it now works with both pages and blog posts.
  7. Note: as of release 0.7 the plugin includes support for the new WordPress shortcode API.
  8. Note: as of release 0.6 the plugin is compatible with WordPress-MU.
  9. 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.8.1.

Download the plugin.

Share this post:
  • Digg
  • Technorati
  • del.icio.us
  • StumbleUpon
  • Facebook
  • Sphinn
  • TwitThis

111 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. February 10, 2009 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!

  2. Gosia Says
    February 18, 2009 4:03 pm

    This plugin is great. Thank you.
    If it was possible to run PHP it would make it perfect.
    Thank a lot

  3. February 18, 2009 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.

  4. darya Says
    February 19, 2009 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?

  5. John Says
    February 25, 2009 10:43 am

    Ajax movable and WYSIWYG-editor would kill. :)

  6. Pete Hawkins Says
    March 4, 2009 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

  7. March 4, 2009 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.

  8. Adfer Says
    March 10, 2009 1:57 am

    Doesn’t work on WP2.7.1, but tanks anyway

  9. Adfer Says
    March 10, 2009 2:38 am

    Wooww, Side Content 0.8 yes works in WP2.7.1 !!!

  10. Jarvis88 Says
    March 10, 2009 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

  11. March 10, 2009 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.

  12. Casey Says
    March 23, 2009 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”

  13. Martin Says
    May 1, 2009 10:08 pm

    Great and very usefull plugin! Thank you!!!

  14. Rob Says
    May 7, 2009 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

  15. Michael Says
    May 27, 2009 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

  16. Aaron Says
    June 15, 2009 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

  17. Adrian Says
    June 17, 2009 4:41 pm

    This is a great plugin thank you so much.
    It worked perfect.

  18. Jeremy Says
    June 17, 2009 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.

  19. Viidar Says
    July 7, 2009 10:13 am

    Great plugin, but do you plan to upgrade it for WP 2.8?
    THAT would just be peachy! :)

  20. July 7, 2009 10:18 am

    I believe it works for 2.8, though I haven’t updated the documentation yet to say so.

  21. July 10, 2009 4:44 am

    I am trying to use this, and it works. Except when I try to add more names for widgets they don’t show up. Only the first one does.

  22. baron Says
    July 11, 2009 3:56 pm

    Works great, thank you

  23. levent Says
    July 11, 2009 4:05 pm

    How can I remove the rest of widgets from the side bar and keep only side content for that specific page?

  24. July 11, 2009 4:35 pm

    Re: Stephen Heck’s query. There was an incompatibility introduced with WP 2.8, now fixed in release 0.9.

    Re: levent’s query. It may be worth looking into the Widget Logic plugin.

  25. levent Says
    July 12, 2009 2:29 pm

    thank you very much Alfred..I ll check it…

  26. Ben Zimmer Says
    July 15, 2009 1:04 am

    Great – exactly what I was looking for.

    One problem: I am also using the Quizzen plugin to create quizzes.
    Quiz content does not seem to embed into the side content.

    Ideas?

    Thanks,
    Ben

  27. Rob Says
    July 22, 2009 8:58 am

    Hi Alfred,

    great plugin, as Ive said before :) One issue that Im having. I am using the plugin on WP 2.6 on all pages of my site with no issues. I then added it to index.php – the blog page.

    I can see in view source that my sidebar div is loading:

    But no content appears that has been input on the index page. Yet all other pages no probs. Any ideas why it wont work on index.php but on all other pages?

    Ive tried 0.8 and just upgraded to 0.9 but the same issue.

    Thanks

    Rob

  28. lnv Says
    August 5, 2009 6:56 am

    Hi Alfred, I am having the same problem with others here. I was able to successfully add a different sidebar widget to 2 different pages. Trying to make it work on a third page however is not working. When I hit “Add custom field” the form flashes, but then it doesn’t appear in the drop-down select nor on the page itself. Any suggestions on this? Thanks and much appreciated.

  29. August 5, 2009 11:22 am

    Lawrence, the plugin now has its own panel at the bottom of the page edit page. You should not need to use custom fields directly.

  30. justin007 Says
    September 14, 2009 4:13 pm

    I Alfred, great widget. Quick question : How can I block all the content plugin to show up on a certain page? I don’t need different widget, I just need to block content on a specific page. Thanks!

  31. September 17, 2009 5:57 pm

    Thanks, Justin. Have you looked into the Widget Logic plugin?

  32. September 24, 2009 3:12 pm

    Hi Alfred

    Great plugin – and it’s working great on my pages. All except the page my bog posts sit on. It’s not giving any errors, the two panels just don’t appear.

    I’m using WP 2.8.4

    thanks
    John

  33. Bill Says
    October 11, 2009 3:44 am

    Is there any way to use the WYSIWYG editor in the widgets?

  34. October 11, 2009 2:48 pm

    Bill, not directly, but you can always use the following trick:

    * open a second edit window as if you were creating a new post
    * use the wysiwyg editor there to create the code you want
    * switch to HTML mode
    * select and copy the HTML
    * paste the HTML into the widget area on the original edit window

  35. jacky Says
    October 18, 2009 7:25 pm

    Great and very usefull Thank you!!!

  36. Juan Antonio Says
    November 7, 2009 7:36 am

    It’s great. Thanks a lot

  37. KC Says
    December 9, 2009 6:21 pm

    Does not work for WP 2.8.6

    I installed it on WP 2.8.6 and there’s a problem. The other normal widgets have lost all their formatting and appears as plain html text.

    I also installed it on my test site running exactly the same thing except WP2.8.4 and it works as expected, no problems.

    Anyone else have similar experiences in 2.8.6?

    cheers

  38. Erdek Says
    December 12, 2009 10:38 am

    Thank you very much

  39. GBarr Says
    December 14, 2009 2:15 am

    It’s working fine for me with 2.8.6. Love this plugin. Between it and Widget Context I’ve got complete convenient control over my sidebars.

« Older Comments

Links to this post

  1. April 28, 2009 7:44 pm: Wordpress als CMS « augenschoner

Some HTML is OK

or, reply to this post via trackback.