New answers tagged

2

You can use the_title filter. Just remember to remove it after wp_list_pages() otherwise it will effect everywhere on the site like in menu, main title, search results etc. Example:- add_filter('the_title', 'my_custom_title'); wp_list_pages(); remove_filter('the_title', 'my_custom_title'); function my_custom_title($current_title) { if ($current_title ...


0

Change the depth parameter to how many levels you want the walker to traverse. From the docs depth parameter description. Number of levels in the hierarchy of pages to include in the generated list. Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to the given n depth). Default 0. Let us say 2 as the depth level , it ...



Top 50 recent answers are included