/home/bdqbpbxa/demo-subdomains/homesearch.goodface.com.ua/wp-content/themes/homesearch/products.php
<?php
// template name: Products overview
get_header();
$srcset = get_template_directory_uri() . "/assets/images/lazyload.png";
?>
<main>
<?php
get_template_part('templates/inner-page-main');
?>
<?php
$objectives = get_field('objectives');
if ($objectives['text']) :
?>
<section class="object-section object-section__single-col <?php echo get_section_color($objectives['block_color']); ?>">
<div class="container -smaller">
<div class="editor -centered-title -bigger">
<?php
echo $objectives['text'];
?>
</div>
<?php
$args = [];
$args['obj'] = $objectives['object_list'];
get_template_part('templates/object-list', null, $args);
?>
</div>
</section>
<?php
endif;
?>
<?php
$args = [];
$args['obj'] = get_field('text_section');
get_template_part('templates/text-section', null, $args);
?>
<?php
$products_list = get_field('products_list');
if ($products_list['title']) :
?>
<section class="equip-section">
<div class="container -smaller">
<h2 class="title title-2 mob-title-2 -centered-title"><?php echo $products_list['title']; ?></h2>
<p class="text text-1 mob-text-2 -centered-title">
<?php echo $products_list['text']; ?>
</p>
<div class="info-card-list">
<?php
$products = new WP_query([
'posts_per_page' => -1,
'post_type' => 'products',
'meta_query' => [
'relation' => 'OR',
[
'key' => 'preview_do_not_show_this_page_on_products_overview',
'value' => 0
],
]
]);
$posts_count = count($products->posts);
if ( $products->have_posts() ) {
foreach ( $products->posts as $key=>$item ) {
$args['is_product_preview'] = true;
$args['obj'] = $item;
if ($key == $posts_count - 2 || $key == $posts_count - 1) {
$args['classes'] = '-bigger';
} else {
$args['classes'] = '';
}
get_template_part('templates/cards/info-card', null, $args);
}
}
?>
</div>
</div>
</section>
<?php
endif;
?>
<?php
get_template_part('templates/testimonials-section');
$args = [];
$args['obj'] = get_field('call_to_action')['call_to_action'];
get_template_part('templates/small-info-section', null, $args);
?>
</main>
<?php
get_footer();
?>