<?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 class="col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2">
<div class="row">
<div class="col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="row blockshadow">
<?php $count = 0; ?>
<?php $count_banner = 1; ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : ?>
<?php the_post(); ?>
<!-- <?php if (($count % 6) == 0) : ?>
<?php if ($count >= 1) : ?>
<div class="col-12 mb-2">
<div class="banner-id">
<?php // echo $byt_theme->get_banner()['column_banner']; //echo $count_banner;//$count_banner?>
</div>
</div>
<?php endif; ?>
<?php $count_banner++; ?>
<?php endif; ?> -->
<?php //$column_banner = $byt_theme->get_banner()['column_banner']; ?>
<?php if (($count % 6) == 0 && isset($column_banner)) : ?>
<!-- квадратный блок рекламы -->
<div class="col-12 mt-3 mb-3">
<div class="banner-id-column_banner">
<?php echo $column_banner; ?>
</div>
</div>
<?php //echo $column_banner; ?>
<?php endif; ?>
<?php
$image_id = get_post_thumbnail_id();
$image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', TRUE);
$image_title = get_the_title($image_id);
?>
<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 $count++; ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part('template-parts/content', 'none'); ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?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() ): ?>
<ul>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>">
<img src="<?php the_field('new'); ?>" />
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php $loop = new WP_Query( array(
'post_type' => 'dish','
posts_per_page' => -1,
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'new',
'value' => '1',
)
)
));
while ( $loop->have_posts() ): $loop->the_post(); ?>