WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm working with a non-wordpress theme called "Misty" and it uses this code to pull categories:

<li class="sidebox">
    <h3><?php _e('Categories','ml'); ?></h3>
    <ul id="catList">
        if (function_exists('wp_list_categories'))

What sucks is that I cant style parent / child categories different, I want to indent child categories but they all go by class=category ID

$catID is how I want to filter posts. 3 different domains are coming to this blog and I am taking where they came from and filtering posts that way. So far I've filtered the category and showed that categories sub-categories, but the subcategories have no way to be styled.

What's a good work around to style the child categories? Is there somewhere I can just add another class to the child LI's?

share|improve this question
up vote 2 down vote accepted

The child ul comes with the class "children", so you can use this to target your css.
ul.children li { }

Even without that, though, you could just use the hierarchy of lists to target..

ul#catList ul li { } would target any li within a ul, within the #catList ID.

share|improve this answer
They are all showing up under #catList for some reason... – Howdy_McGee Jan 12 '12 at 20:36

You shouldn't have any problem making parent and child categories look different using CSS. Go to view source and you should see something like:

    <ul id="catList">

            <li class="cat-item cat-item-1"><a href="http://yourdomain.com/category/misc/" title="Miscellaneous and Unsorted Posts">Misc.</a> (1)
    <li class="cat-item cat-item-4"><a href="http://yourdomain.com/category/newsletter/" title="View all posts filed under Newsletters">Newsletters</a> (9)
<ul class='children'>
    <li class="cat-item cat-item-79"><a href="http://yourdomain.com/category/newsletter/test/" title="just a test. delete whenever.">test</a> (1)

See where it says ul class="children" ? Make a default style for all category menu items and then override that with the "children" class (something like #catList ul.children li a {color: green} which would make all child category links green).

Hope that helps :)

share|improve this answer
:/ IDK why mines not doing that. I have them as subcategory posts in my wordpress admin panel, but when I view the page all of them are under catList – Howdy_McGee Jan 12 '12 at 20:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.