• Resolved pixelcreme

    (@pixelcreme)


    Hey I got another question about styling some items in a sidebar of a site I’m working on. Here is the URL: https://pixelcreme.com/screationz/hello-world (the inner page is the one I have a question with).

    The categories on the right, I want every OTHER category to have a background image, similar to what I have on the homepage (but the homepage is static, not dynamic.

    Is there a way to style every even category differently than the odd ones? Thanks for your help in advance, I always get my questions answered quickly here.

    Regards,
    Jared

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter pixelcreme

    (@pixelcreme)

    Also I would like to know if there is a way where I can put two characters in front of each category. (I want ‘->’ before each category without the quotes)

    Thread Starter pixelcreme

    (@pixelcreme)

    Anybody? ??

    what is the code that does the category list in the sidebar?

    (as it does not seem to be standard wordpress, it would be really helpful to know how it is done; there is maybe an easy way to add these ‘even’ ‘odd’ classes, and the prefix -> )

    Thread Starter pixelcreme

    (@pixelcreme)

    <p class="cats"><?php wp_list_categories('title_li=&depth=1&style=none'); ?></p>

    This is the code that gets the categories. It displays them with a line break instead of an li with the style=none I think, so how would I go about doing that?

    When I remove style=none and then try to style the ul without a list icon, nothing happens.

    p.cats ul {
     list-style: none;
    }

    The code above does not work, not sure why. It’s kind of strange but I can figure that out with a little snooping around.

    But there you have it, the code that displays the categories is above.

    Thread Starter pixelcreme

    (@pixelcreme)

    I fixed the background image thing using CSS3’s :nth-child() selector.

    Now all I need is the -> to be before each category.

    possibly with css as well:

    p.cats a:before { content: '->'; }

    or

    #sidebar-single li.cat-item a:before { content: '->'; }

    Thread Starter pixelcreme

    (@pixelcreme)

    Thanks very much it works.

    ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Styling Every Other Category using wp_list_categories’ is closed to new replies.