Forums

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

  1. noel4nopun
    Member
    Posted 2 weeks 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 weeks 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

Reply

You must log in to post.

About this Topic

Tags

No tags yet.