0


I have posts with two different design in a loop, i doesn't known how to show that.
I use a checkbox ( 'meta_key' => 'nabro_post_photo' ) for a posts have different design to will specify.I create to different query but now i doesn't known how to should use that in a loop

This is my code

<?php
$args = array(
    'posts_per_page' => 10,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
);
$the_query = new WP_Query($args);

$args2 = array(
    'posts_per_page' => 10,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
    'meta_key' => 'nabro_post_photo',
    'meta_value' => '1',
    'meta_compare' => '==',
);
$the_query2 = new WP_Query($args2);
?>

<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
  <article class="post-content">
  </article>
<?php endwhile; ?>
<?php endif ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.