<?php $loop = new WP_Query( array('post_type' => 'post','posts_per_page' => -1,'order' => 'ASC',));
while ( $loop->have_posts() ): $loop->the_post(); ?>
<?php if (get_field('name_field') == 'yes'): ?>
// echo
<?php endif ?>
<?php endwhile; wp_reset_postdata(); ?>
<?php $loop = new WP_Query( array(
'post_type' => 'post','
posts_per_page' => -1,
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'name_field',
'value' => '1',
)
)
));
while ( $loop->have_posts() ): $loop->the_post(); ?>
// echo
<?php endwhile; wp_reset_postdata(); ?>
<?php
// args
$args = array(
'numberposts' => -1,
'post_type' => 'dish',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'new',
'value' => '1',
),
)
);
// query
$the_query = new WP_Query( $args );
?>
<?php if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div loading="lazy" id="tagmarginelements" class="col-12 col-xs-12 col-sm-12 col-md-4 col-lg-4 col-xl-4 mb-2">
<a href="<?php echo get_permalink(); ?>" class="not-link text-black" data-wpel-link="internal">
<div data="<?php echo $yebiwes ?>" class="dish card rounded-0 p-0 h-100">
<div class="card-body">
<h5 class="card-title" style="font-size: 18px"><?php the_title(); ?></h5>
<div class="text-center"><?php the_post_thumbnail('full', array('class' => 'img-fluid', 'alt' => $image_title, 'title' => $image_title)); ?></div>
<div class="like-btn"><?php echo do_shortcode( '[wp_ulike]' ); ?></div>
</div>
<?php if (has_post_thumbnail()) : ?>
<?php endif; ?>
</div>
</a>
</div>
<?php endwhile; ?>
<?php endif; ?>