• Hi I am using this:
    <?php wp_list_pages(‘title_li=’); ?>

    and it displays all my pages just fine. I need to and a custom class to the ‘ul’ and ‘li’ tags and was wondering how to do that. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • html/php:

    <ul class="yourClass">
    <?php wp_list_pages('title_li='); ?>
    </ul>

    CSS:

    .yourClass li {
    /* insert rules here */
    }

    Thread Starter rondog

    (@rondog)

    Oh…I didnt realize that it wasnt adding ul tags…awesome..thanks!

    My next question is, how can I add a class to the li tags then? The reason I ask is I have a 3 tier menu and when the 2nd tier has a 3rd tier item I need to add a class to it to add a little arrow next to it.

    .yourClass li ul li {
    / *insert rules here */
    }

    You should be able to target nested li’s as far in as you need to with this method.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘setting a class on ul and li tags’ is closed to new replies.