WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_categories selected states only working 2 levels down (5 posts)

  1. desmondo
    Member
    Posted 5 years ago #

    Hi all,

    I'm playing around with the navigation with wordpress and it has really improved with 2.7. I basically have a single line of code to list all categories and their siblings in correctly formatted lists. Here is the line of code:

    <?php wp_list_categories('show_count=0&amp;title_li=0');

    The only issue, is the selected classes. There only seems to be 2 levels of classes - current-cat-parent & current-cat, which means when I am down to the third level of the category hierarchy, the parent tab no longer has a class to show it is selected. Here is the HTML it is producing:

    <ul id="topNavigation">
    	<li class="cat-item cat-item-1">
    		<a href="/">Main Parent</a>
    		<ul class="children">
    			<li class="cat-item cat-item-7 current-cat-parent">
    				<a href="/">test category</a>
    				<ul class="children">
    					<li class="cat-item cat-item-8 current-cat"></li>
    				</ul>
    			</li>
    		</ul>
    	</li>
    </ul>

    I would like the parent category to be selected for all levels of sub-nagation. Is it possible to do this? I've been searching to no avail for ages and would greatly appreciate any help.

    Thanks

  2. desmondo
    Member
    Posted 5 years ago #

    Hi all, sorry to bump. Can anyone point me in the right direction?! Would really appreciate any help as I am still stuck :)

  3. desmondo
    Member
    Posted 5 years ago #

    Just wanted to try bumping one more time! Would anyone know how to fix this?!

  4. greggo
    Member
    Posted 4 years ago #

    You ever get any resolution to this? It's killing me!

  5. r-a-y
    Member
    Posted 4 years ago #

    Need this as well!

Topic Closed

This topic has been closed to new replies.

About this Topic