List Pages with Specific meta key/value Help PLEASE?
-
Trying to use wp_list_pages() to generate a list of Pages, listing <b>only</b> those Pages with a specific meta key value (custom field value).
So far, I’ve got this:
< ? php // get the meta value for the key 'foo' $Cluster = get_post_custom_values('foo'); // make sure that worked print_r($Cluster); // I'm ok here, so far // if $Cluster not null, list the Pages with the custom key 'foo' and the value 'bar' THIS IS WHERE IT DOESN'T WORK: if ($Cluster !== '') { echo '<div class="article_links"><h4>Learn More</h4><ul>'; wp_list_pages($Cluster); echo '</ul></div><!-- .article_links -->'; } ?>
Passing the $Cluster argument to the wp_list_pages function only results in an ul of ALL pages, not a list of Pages with only the key/value I want (foo/bar) in this example.
The wp_list_pages page of Codex states I can use the function
“restricted to Pages with specific meta key/meta value (not shown in defaults above)
does ANYONE have an example of the correct syntax for wp_list_pages that restricts the list to Pages with specific meta key/values????
PLEASE??
Thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘List Pages with Specific meta key/value Help PLEASE?’ is closed to new replies.