1

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 ?

1
  • In fact i like to have ONLY a claen list made of <ul> and <li>
    – menardmam
    Commented Jan 21, 2013 at 18:12

1 Answer 1

4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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