Get Posts With A Specific Custom Field & Value

Add the query_posts() function just before the Loop. Change the meta_key and meta_value accordingly. The example shown below will get posts with custom field “review_type” with value “movie”.

<?php query_posts('meta_key=review_type&meta_value=movie');  ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>


There are no revisions for this post.

Tags: ,

No comments yet.

Leave a Reply