• ‘Ello,

    I’m trying to build up a list of pages to exclude from the wp_list_pages function using get_pages to build a list depending on the value of a custom field. My problems is that when I have a parent custom field visibility set to Yes (so it can be seen) and all the children set to No it ignores the child custom field and just show them all. If I set the parents visibility to No then it pays attention to what the children are set to and either shows them or not depending on their visible value.

    Any help will be greatly appreciated, the code I am using is below.

    $navChildVisibility = get_pages('meta_key=visible&meta_value=No');
    
    $exclude = "&exclude=";
    
    foreach ($navChildVisibility as $pageID)
    {
    $exclude .= $pageID->ID.",";
    }
  • The topic ‘get_posts with meta data ignoring children’ is closed to new replies.