Dynamic Dynamic WordPress Sidebars

It’s always a drag trying to make sidebars the same height as the page content – too short and your page gets boring at the bottom, too long and your page looks like a run-on sentence.

Is there any way to add/remove/display widgets based on content length, so that the sidebar will only display another widget if there’s a ton of sidebar whitespace available?

Read More

I’m aware of the overflow CSS property, and would rather try to find a different method 🙂

Related posts

Leave a Reply

2 comments

  1. I agree that it would be better to avoid this altogether. Users are used to a constant sidebar size, with some pages shorter than the sidebar and some longer than the sidebar.

    However, that doesn’t actually answer your question. It is theoretically possible to determine the length of the post and make some judgements on which widgets to include based on that; however, it’s beyond my skill.

    As a halfway solution, you can use a widget that gives you more control over the sidebars. I prefer http://wordpress.org/extend/plugins/conditional-widgets/ but I think http://wordpress.org/extend/plugins/widget-wrangler/ would work well too. With those you could specify which widgets appear on which pages. If you have hundreds of posts of different lengths this may not be suitable, but if you have a handful of pages you could use this to add more widgets to specific pages and have fewer widgets on pages you know are shorter.

    Hope this helps!