WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>

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
up vote 2 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

Your Answer


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.