• I’m having difficulty figuring out how to use plug-ins that perform as widgets on category-specific sidebars. Certain plug-ins add a widget you may apply to the numbered sidebars in the presentation>widgets Sidebar Arrangement panel. Though I see that the number of sidebars is adjusted in some code in the “functions.php” file, I don’t understand how these numbered sidebars correspond to the sidebars I customize for different category pages. Please forgive my ignorance. I’m new to WordPress and PHP, and sketchy with CSS and HTML. I intend to improve my skills with all the above. In the meantime, I very much appreciate assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    I’m a novice myself, but I just figured out (by means of reading others excellent support responses) something comparable to this that I thought I’d share. However, mine is for displaying different sidebars based on the page, not category. You could certainly replace the following code to work with is_category in place of is_page. The functions.php declares how many sidebars you have. For example:

    <?php
    
    if (function_exists('register_sidebars')) register_sidebars(9, array('before_widget' => '','after_widget' => ''));
    
    ?>

    See the number 9 after register_sidebars? It declares 9 sidebar widgets.

    I have two sidebars on my site. On my Page template I do the following:

    <?php
    if (is_page(14))
        {if( function_exists('dynamic_sidebar') && dynamic_sidebar(5) ) ;
        }
    elseif (is_page(15))
        {if( function_exists('dynamic_sidebar') && dynamic_sidebar(4) ) ;
        }
    elseif (is_page(7))
        {if( function_exists('dynamic_sidebar') && dynamic_sidebar(9) ) ;
        }
        else
        {if( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) ; else ;} ?>

    Each number after dynamic_sidebar correlates with its respective sidebar under the Themes -> Widgets portion.

    For my right sidebar, I do the following:

    <?php
    if (is_page(7))
    {
    }
    else
        {include (TEMPLATEPATH . '/rightsidebar.php'); } ?>

    This says, if my page is page 7 (my static homepage), don’t get a right sidebar, otherwise, include the rightsidebar file.

    Alternatively, I use another file called rightsidebarpost and call in that with the include statement on the Single.php file in my theme…so I can have a different right sidebar on post pages.

    I hope this helps a bit to understand the logic.

    Kindly,

    Michael

    Thread Starter thebradmiskell

    (@thebradmiskell)

    thanks, michael, for your very thorough explanation. i’m going to have to spend some time tinkering before reporting back to you and others on how your understanding informs mine, and on any further enlightenment (i trust) i gain in the process.

    zszaiss

    (@zszaiss)

    On this same topic, I have a question (incidentally, I think it’s the one thebradmiskell was trying to ask).

    So you follow mfshearer72’s advice and you get different sidebars on different category pages. But that’s only part of the story:

    1. How do you get multiple instances of the same widget to place on these different sidebars? It seems that you can add multiple Categories, Text, and RSS widgets to your pool, but nothing else.

    2. Once you do get multiple instances of the same widget, how do you orient them to be category-specific? This answer probably varies on a widget-by-widget basis (some support this well, others not at all), but it’s an answer I haven’t been able to find yet.

    Thanks for any help anyone can provide.

    What particular widget do you want to repeat that you cannot?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting plug-in widgets on category-specific sidebars and not everywhere else…’ is closed to new replies.