WordPress.org

Ready to get started?Download WordPress

Forums

Customisation of wp_list_pages (3 posts)

  1. drtanz
    Member
    Posted 3 years ago #

    I would like to generate a list of pages on my site in the following format

    [please use backticks or the code button to mark your code]

    <ul class="menu">
    
    <li><h3>Top level item</h3>
    <ul>
    <li>Second level item</li>
    <li>Second level item</li>
    </ul>
    </li>

    As you can see it is not only a question of adding a depth of 2, the problem lies in the fact that I want an H3 only for top level items, how can I do this? Thanks.

  2. stvwlf
    Member
    Posted 3 years ago #

    Try generating the H3 at all levels and then hide displaying H3's at the lower levels.

    I think this will do it.
    ul.menu ul h3 { display: none; }

  3. drtanz
    Member
    Posted 3 years ago #

    That would hide the whole element though, sorry I was a bit unclear, inside the h3 I have link which must be shown

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.