How to tell if wp_list_pages returns no pages
-
I currently use some search criteria with wp_list_pages to return a menu for my users. This works great until wp_list_pages doesn’t return anything. So I am trying to determine if wp_list_pages is blank so that I can tell the customer to “try again” but I can’t seem to get it to work. This is what I have but it does’t work –
$children = wp_list_pages(‘title_li=&child_of=1700&meta_key=location&meta_value=vegas&sort_column=post_title’);
if ($children) {
echo ‘- ‘.$children.’
‘;
} else {
echo ‘- No results match your criteria.
- Please try again or use our SEARCH.
‘;
}
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘How to tell if wp_list_pages returns no pages’ is closed to new replies.