Support » Plugins » Widget/sidebar for each category?

  • Hi
    Is there such a plugin available:

    I’d like the posts in each category to show it’s own sidebar – or even better: To have one widget to show up on the posts of each category.

    I’m converting a site about Italy, and for each region I’d like the top of the sidebar to show info, links etc which are relevant for just that region.
    Eg, on the Toscana page I would like it to show links to local places, photo galleries etc which are not relevant on the Sicilia posts – have a look at the right side here.
    So – I don’t need a widget that displays categories, but a plugin that assigns one unique widget in the sidebar of each category’s posts.

    I’ve tried to achieve it using the html templates and the Widget changer. The widget changer comes closest, but since it can only be used on posts (and pages), and not on categories, it has to be inserted and even edited in the posts one by one. (I’d even have to format/prepare the contents in an html editor, Dreamweaver or the like.)

    Such a plugin would save me lots of work, so I’m grateful for any suggestions.


Viewing 15 replies - 1 through 15 (of 22 total)
  • No such thing?
    Crucial for using WP as a CMS, I believe – so still hoping
    🙂 Kj

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    No such thing yet. It’s being planned to allow for custom sidebars like that though. Probably not until WP 2.6.

    Hm – Ok
    Thought about another possibility.
    Since each region has its own category (thats how I can post to multiple pages) and I’d have to make a template for each category – then I could make a different sidebar template for each category as well. or mayby make the sidebar a part of the page template.
    Someting like that…?

    PS This “pages” thing is confusing. Why not call a static Page a page, while the pages generated by each post in a blog is a sheet? Just a thought.

    try out my new widget Widget Logic. At worst you could have a text widget for each category set to appear only when is_category(x).

    Might be just what I’m looking for. The sidebar should have a category-unique widget + the standard widgets (or maybe I’ll even need some single-page widgets as well, but Widget changer solves that part)

    It says its only compatible up to 2.3.2?
    I’ll tell you over the weekend how things have gone.

    (i’ve only bothered with 2.3.1 and then done spot fixes of the important bugs in 2.3.2 and 2.3.3)

    cheers. i should have said that Widget Logic is a PLUGIN not a widget. it’s a plugin that allows you to specify on which pages any widgets appear.

    You can for instance set a widget (eg a Text widget) to appear if:

    is_category(4) || in_category(4) || is_page(‘umbria’)

    Thanks, got the point 🙂
    The very best so far – it ALMOST fill my needs – but is there any way to activate more text widgets? Or some other way around?

    Point is:
    I’d like different texts to appear in the top of the sidebar on each category’s posts. Your plugin does this perfectly: If I insert eg “is_category(‘9’)” in the conditional field that the plugin gives each widget, that widget only show up beside the category 9 posts.
    So far, so good – but:
    My Italy site will have 20+ categories (as there are 21 regions in Italy), while the Presentation > Widgets panel gives maximum 9 of each widget type.
    Any way to get around?

    Thanks again

    PS Your ReadMe text is very helpful, but inserting a conditional text as said there, returns an error. “is\_category(5)” makes it wrong – “is_category(‘9’)” makes it right. Just like to tell you 🙂

    good point. i will amend my readme. (The ‘development’ version is already quite modified from what you see.)

    i can think of 2 main options

    1 – write category-1.php category-2.php etc files one for each category with your text written into each of those

    2 – use the category description and find a widget that lists category descriptions (for each category a post is in). alternatively write your own code to print that description. Something like:

    if (is_category()) { echo category_description($cat);}

    hope this helps

    Thanks for sharing your thoughts.
    I’ve already made different category templates, so that’s fine. (Need them to make post in different categories to show up on different sheets (not to mix up with Pages).)
    I don’t believe too strongly, though, that a category description will do, since I’d have to include some code (basically html) in it.
    I might just write each category’s own code into a sidebar.php for each and every category (like sidebar-1.php). Using your plugin wuold be much more elegant, but…

    It should be quite essential for using WP as a CMS, but as Otto said, maybe it’ll be part of WP 2.6 – and that should be about in the time I need to fill everything into this (for now) 250 page site 🙂

    Grateful for your help

    thing is you’ve got text for lots of categories. so how/where to store them. without some extension to WP via a plugin, the description seems the only place to hand. and you can use HTML in category descriptions. (well i do on one blog i admin, and i don’t recall hacking it, or using a plugin to do so!)

    using standard WP you get up to 9 text boxes. change the number in the pull-down box.

    I’m wondering if you could change the number to a higher one?


    With the text widget in widget-logic, can you input php functions? *edited: it doesn’t work. Text will show, images will show, links will show, but a function like:

    <?php wp_list_categories('orderby=id&show_count=1
    &use_desc_for_title=0&child_of=8'); ?>

    will not show.
    *end edit

    For me the question ended up in how to get more than 9 text widgets available. I haven’t tried it myself yet, but after asking here, the answer seems to be in this tread
    Together with the widget-logic plugin, this should solve things for me.

    PS This tread is also worth reading

    Way cool! I knew it had to be something that easy, but will it be replaced when you upgrade? (back it up and make notes…I guess)

    OK, so I’ve read in the documentation that text widgets support html and javascript markup.

    So…can anyone show me a link to an example for the wp_list_categories function that is in either of these two formats. I’ll figure out what I need from there.

    I found it! the perfect combo…
    widget-logic and
    this one:

    To put it more precisely, to get more text widgets – have a look at my latest reply here.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Widget/sidebar for each category?’ is closed to new replies.