WordPress.org

Ready to get started?Download WordPress

Forums

Styling Parent Categories (5 posts)

  1. YellowSwordfish
    Member
    Posted 9 years ago #

    Apologies if it has been covered but does anyone know if it is possible to style a Parent category link in the sidebar differently to it's Children categories?` Even if only a different colour.

    It would be nice also not to show the post count on Parents if they are zero whilst retaining posts on Children but I fear that is going to be in the list_cats and wp_list_cats code but if you know a way I'd love to hear of it.

    Thanks

  2. Lorelle
    Member
    Posted 9 years ago #

    Since they are in nested lists, you can style the lists however you want.

    http://codex.wordpress.org/Styling_lists_with_CSS
    http://codex.wordpress.org/Customizing_Your_Sidebar

  3. YellowSwordfish
    Member
    Posted 9 years ago #

    Thanks Lorelle. The first has some good info although I tried the obvious with strange results. Used:

    #sidebar ul ul ul li {
    color: red;
    }

    which worked on the correct child categories but only coloured the post counts red - not the actual category text! I don't quite know what to make of that... But I will keep digging.

  4. YellowSwordfish
    Member
    Posted 9 years ago #

    Sorted.
    Needed to include the anchor tag as:

    #sidebar ul ul ul li a {
    color: red;
    }

    Now I can work with this. Thanks for the pointer - it can be hard sometimes to find the right codex page within the wealth of good info... especially if CSS is a new endeavour!

  5. Lorelle
    Member
    Posted 9 years ago #

    Glad you helped yourself. The link aspect is always a PITA with these nested lists.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags