• Hi everybody,

    This is about customized sidebar management.

    I just found this nice piece of code which automatically creates an individual sidebar for each category page. It’s a simple copy&paste but necessary to read to understand the problem, I guess.

    Though I’m not really confident with PHP, I suspect the problem in the following step. In the sidebar.php template he wants me to replace
    dynamic_sidebar($sidebar);
    with
    dynamic_sidebar( $sidebar_id );
    With this, the whole thing takes effect: The new sidebars are shown in the “Widget” toolbox and they appear on the actual category pages as well. But by doing it, all the other sidebars (from startpage, any other page, single-post-view etc) simply disappear. Switching around in the Theme Options etc doesn’t help here. The other way around: when I remove the _id again, the sidebars for the category pages are set back to the default “Primary” sidebar, the sidebars I adjusted via GUI reappear and the code has no effect.

    My very wild guess: the $sidebar_id is defined via category IDs and is just not put into effect if there is no category ID which can be prompted … but as I said, I hardly know anything about PHP syntax.

    My questions are: Is there a workaround for this? I don’t really need the sidebars to be shown on regular pages (would be nice, though) but the frontpage is too boring without the sidebar… Is there a possibility to add something like a condition that forces a certain sidebar if the page is NOT a category page?

  • The topic ‘"Individual Sidebars for Category Pages" disables Sidebars on any other Page’ is closed to new replies.