Ready to get started?Download WordPress


conditional statement with wp_list_categories (2 posts)

  1. xiabolai
    Posted 5 years ago #


    I have a question about where to place a conditional statement with a dropdown menu and wp_list_categories. Have searched and tried many things but nothing works.

    Here's my site for reference: http://newsite.blairshapiro.com

    Here's my header.php code to create a dropdown menu:

                         <?php wp_list_categories("exclude=$blog_ID&title_li="); ?>

    I want to highlight 'Work' when in one of the subcategories created by wp_list_categories and think I need to place the following conditional statement in either the "li" segment or the "ul" segment:

    <?php if(is_category){ echo ' class="current_page_item" ';}?>>

    My question is, where do i place the conditional statement and how to best style the css so 'Work' is highlighted when in one of the subcategories created by wp_list_categories?

    Any help would be appreciated!

  2. xiabolai
    Posted 5 years ago #


    Anyone? Would really appreciate any advice. I'm totally stumped.

Topic Closed

This topic has been closed to new replies.

About this Topic