Re: Functions for generating a menu of WordPress pages
The code above has some errors in it: $thisPage
is used when calling bb_list_pages()
recursively, but this param isn’t defined anywhere but in the function’s description… In function definition that param is instead named $parent_uri
.
Moreover $kids <> ""
should be replaced by !empty($kids)
and I’m not sure that wordpress_mu_primary_blog_id
has any meaning now that WP 3.0 has merged WP and WPMU…
Last, calling bb_list_pages()
with no args, makes if ($depth == 0)
true, resulting in an empty string returned. It would be good to use the same template of wp_list_pages()
, which lists all pages if no param is passed to it (see docs). By the way, this could be the reason why you get nothing displayed when calling the function.