[Help] Wordpress Code

twisted_one

Power Member
Joined
Oct 11, 2009
Messages
521
Reaction score
96
<li <?php if(is_home()) { echo ' class="current-cat" '; } ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_categories('depth=1&hide_empty=0&orderby=name&order=ASC&title_li=' ); ?>
This code means that the header will have links like

HOME | <Category Names>

My problem is

When I have a Sub Category, it is not displayed when I hover my mouse over the parent category. For example, say there is a Category MAIN with two subcategories SubA and SubB. I want SubA and SubB to be displayed when I hover my mouse over MAIN.

How can do this?

I tried this code

<li <?php if(is_home()) { echo ' class="current-cat" '; } ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_categories('depth=1&hide_empty=0&orderby=name&order=ASC&hierarchical=true&title_li=' ); ?>
This displays the subcategories SubA and SubB only when I click on MAIN and not when I hover on MAIN category.

Any help on how to achieve this?
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock