query post with custom field
-
Hi there
In trying to query custom posts in the category apartmentcat so that only those that have with a meta value of australia for custom field key location are shown.how is this done? any help would be appreciated.
I have the following but no where does it specify the value that is required for the query.<?php $values = get_post_custom_values("location"); ?> <?php $catinclude = 'apartmentcat=' . $cat;?> <?php query_posts('&' . $catinclude . ' &paged=' . $paged . '&showposts=30' . '&orderby=menu_order'); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
I also tried something more simply like
<?php query_posts('meta_key=location&meta_value=australia&showposts=30&orderby=menu_order'); ?>
but this showed no results.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘query post with custom field’ is closed to new replies.