Your initial concrete problem
Mkay. I think I understood what it is you are trying to do.
You are attempting to identify the pages (and subpages) you want to list by the page template being used by the parent pages and that by means of checking the value of the _wp_page_template
postmeta.
For one, that feels like a rather hacky approach in the first place, and, for another, it is in the nature of how the meta_value
parameter works, that it then will exclude all pages, that do not have that custom field value set.
If you must stick to wp_list_pages
, the simplest solution might be to create one more (utility) page, make that the uber-parent of all brand-pages and make use of the child_of
parameter:
$brands = wp_list_pages(
array(
'title_li' => '',
'child_of' => 123 // page ID of the uber-parent
)
);
Note that wp_list_pages
does neither accept a lang
nor a showposts
parameter. Those are most certainly meaningless to the function.
Further, 'page'
is the default argument for the post_type
parameter and hence redundant.
Also note that wp_list_pages
is not the most flexible approach to creating a menu. If my admittedly also rather quick and dirty solution offered above does not cut it, you might want to familiarize yourself with wp_nav_menu
or custom queries and the WP_Query
class instead.
Your general architectural approach
Pertaining to your edit:
Again, it isn’t as if one definite correct solution exists, as now we’re not talking about a concrete problem anymore but are entering the realm of architecture.
Given the information you have provided, this would be my approach:
I’d create a custom taxonomy for the brands (where the actual brands, such as “Nike”, are the terms) and a custom post type for the products.
Either one post type called “product”, where the kinds of product (“Shoe”, “Shirt”, “Sunglasses”) are identified by metavalues, or a post type for each type of product (likely cleaner).
The products themselves (“Shoe 1”, “Shoe 2”) then will be posts of type “product” (or “shoe”, respectively).