Querying two custom fields in custom post type..
-
Ok so I can get it to work with querying one custom field but when I try two it doesn’t work like I would think it would.
Here is my code:
<?php $args = array( 'post_type' => 'ait-dir-item', 'meta_key' => 'location', 'meta_value' => 'Annapolis', 'meta_key' => 'item_tags', 'meta_value' => 'Non-Marine', 'posts_per_page' => 300 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title('<h3 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h3>'); echo '<div class="entry-content">'; the_content(); echo '</div>'; endwhile; ?>
Thanks in advance!
Cory-
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Querying two custom fields in custom post type..’ is closed to new replies.