armanty-quests/parts/home/entertaiment.php

91 lines
4.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<section class="ent <?php
if( is_home()){
echo 'wave';
}else if (is_page(24)){
echo 'wave wave-no-bottom';
}
?>">
<div class="ent-container">
<h2>Все развлечения</h2>
<div class="owl-carousel ent-slider container">
<!-- Выводи список квестов -->
<?php
$posts = get_posts( array(
'category' => 0,
'orderby' => 'date',
'order' => 'ASC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'armanty_quests',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
foreach( $posts as $post ){
setup_postdata($post);?>
<div class="ent-container__quest <?php echo get_field('quest_alias', $post->ID);?>" style="background: url('<?php echo the_post_thumbnail_url() ?>'); background-size: cover">
<div class="ent-container__quest-overlay"></div>
<div class="ent-container__quest-content">
<div>
<h3><?php the_title();?></h3>
<p><?php the_excerpt();?></p>
<div class="quest-description__icons_main">
<div class="quest-people">
<img src="<?php echo get_template_directory_uri() ?>/assets//img/quests/quest-people-big-white.svg" alt="">
<span><?php the_field('quest_players_min')?>-<?php the_field('quest_players_max')?> игроков</span>
</div>
<div class="quest-time">
<img src="<?php echo get_template_directory_uri() ?>/assets//img/quests/quest-time-big-white.svg" alt="">
<span><?php the_field('quests_time')?> минут</span>
</div>
<div class="quest-age">
<img src="<?php the_field('quests_age')?>" alt="">
<!-- <i class="fa fa-child" aria-hidden="true"></i> -->
<!-- <span><?php echo the_field('quest_level'); ?> из 5</span> -->
</div>
</div>
</div>
<a href="<?php echo the_permalink(); ?>"><button>Подробнее</button></a>
</div>
</div>
<?php
}
// ID локально и на сайте могут отличаться, смотреть по URL в админке WP
$departure_id = 609;
$the_post = get_post($departure_id);
$description = get_field('departure_description', $departure_id);
?>
<div class="ent-container__quest departure" style="background: url('<?php echo get_the_post_thumbnail_url($the_post) ?>'); background-size: cover">
<div class="ent-container__quest-overlay"></div>
<div class="ent-container__quest-content">
<div>
<h3><?php echo $the_post->post_title ?></h3>
<p style="margin-top: 20px; margin-bottom: 20px">Квест и программа на природе на вашей площадке</p>
<br>
<div class="quest-description__icons_main">
<div class="quest-people">
<img src="<?php echo get_template_directory_uri() ?>/assets//img/quests/quest-people-big-white.svg" alt="">
<span><?php echo $description['players_min']?>-<?php echo $description['players_max']?> игроков</span>
</div>
<div class="quest-time">
<img src="<?php echo get_template_directory_uri() ?>/assets//img/quests/quest-time-big-white.svg" alt="">
<span>от 2 часов</span>
</div>
<div class="quest-age">
<img src="https://armanty-quests.ru/wp-content/uploads/2020/03/5-1-1.png" alt="">
<!-- <i class="fa fa-child" aria-hidden="true"></i> -->
<!-- <span><?php echo the_field('quest_level'); ?> из 5</span> -->
</div>
</div>
</div>
<a href="<?php echo get_post_permalink($departure_id); ?>"><button>Подробнее</button></a>
</div>
</div>
</div>
</div>
</section>