Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

here is the code :

add_shortcode ('get_menu_child','get_menu_child');
   function get_menu_child ($att) {

       global $wp_query;
       $thePostID = $wp_query->post->ID;

       $output = '';
       $output .= '<div class="childbutton">';
       $output .= wp_list_pages("echo=0&child_of=5&exclude=".$thePostID."");
       $output .= '</div>';

    return do_shortcode($output);
   } 

here is the output :

<div class="childbutton">
<li class="pagenav">Pages<ul>
<li class="page_item page-item-46"><a href="#">Culte et culture</a></li>
<li class="page_item page-item-49"><a href="#">Écoles</a></li>
<li class="page_item page-item-43"><a href="#">Organismes communautaires</a></li>
<li class="page_item page-item-52"><a href="#">Parcs et camping</a></li>
<li class="page_item page-item-40"><a href="#">Tourisme</a></li>
</ul></li></div></p>
</div>

Question why the function return a "extra" pages text "PAGES" how to get rid of it ?

share|improve this question
    
In fact i like to have ONLY a claen list made of <ul> and <li> –  menardmam Jan 21 '13 at 18:12
add comment

1 Answer

up vote 1 down vote accepted

ok, found the answer here : http://codex.wordpress.org/Function_Reference/wp_list_pages#Exclude_Pages_from_List

here is the core of the answer :

Markup and styling of page items

By default, wp_list_pages() generates a nested, unordered list of WordPress Pages created with the Write > Page admin panel. You can remove the outermost item (li.pagenav) and list (ul) by setting the title_li parameter to an empty string.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.