• Hello all. I’m using wp_list_bookmarks to show a list of links in my sidebar, however, I want to only show specific categories on specific pages. Is there a way to do this without creating new templates for each page? I’d like to stay dynamic and keep it all in the sidebar.

    Code:

    <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
    
    				<ul class="side-list">
    					<?php wp_list_bookmarks('title_li=&categorize=0&category=3'); ?>
    				</ul>
    
    			<?php endif; // end dynamic_sidebar ?>

    Thanks so much in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter brianrenew

    (@brianrenew)

    Just to be clearer, I have have a few pages that need to show category 3 from my links, and then I have a few more pages that need to show category 2, and others that need to show category 4; and so on.

    Thread Starter brianrenew

    (@brianrenew)

    Update*
    I’ve decided to use wp_list_pages instead since I’m listing pages within my site.

    However, I still would like to create an if statement or something that tells my sidebar to only list pages when on on specific pages, but list other pages when on those specific pages. All of this in the sidebar.php file.

    Can anyone help? Please!

    Thread Starter brianrenew

    (@brianrenew)

    Thank you so much for the link. I feel that it will come in handy with my newbie PHP struggles.

    However, in the mean time, can you please help me get started with the structure of my statement. I want something like this (but in PHP of course):

    if page is ID 1,2,3
    then do this code: wp_list_pages(‘sort_column=menu_order include=1,2,3&title_li=’ );

    but if the page ID is 4,5,6
    then do this code: wp_list_pages(‘sort_column=menu_order include=4,5,6title_li=’ );

    Something like that. Thanks!

    Thread Starter brianrenew

    (@brianrenew)

    I still haven’t been able to figure this out. Can anyone help?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sidebar: Multiple Categories but only show 1’ is closed to new replies.