Forums

add id to the li tag for wp_list_pages (4 posts)

  1. noel4nopun
    Member
    Posted 2 years ago #

    I would like the output of
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=1");

    to look like

    <ul>
    		<li id="1" class="page_item page-item-182 current_page_item"><a href="#">Child 1</a></li>
    <li id="2" class="page_item page-item-190"><a href="#">Child 2</a></li>
    	</ul>

    note that I want to add my own "id=$count"

  2. equalmark
    Member
    Posted 2 years ago #

    Could you not use the count from the page item number that the function assigns to each list tag? In your example this is page-item-182

  3. Casemon
    Member
    Posted 2 years ago #

    Hmm would like to do this too...

    Any other ideas on adding ID to the output of wp_list_pages?

  4. Casemon
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.