39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<div class="cert-items">
|
|
<h2>Вы можете приобрести подарочный сертификат онлайн</h2>
|
|
<div class="row justify-content-center">
|
|
<?php
|
|
$posts = get_posts( array(
|
|
'category' => 0,
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
'include' => array(),
|
|
'exclude' => array(),
|
|
'meta_key' => '',
|
|
'meta_value' =>'',
|
|
'post_type' => 'armanty_certificate',
|
|
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
|
) );
|
|
|
|
foreach( $posts as $post ){
|
|
setup_postdata($post);?>
|
|
<div class="col-12 col-lg-6">
|
|
<img src="<?php echo get_the_post_thumbnail_url()?>" alt="money"><span data-certprice="<?php the_field('cert_price')?>"><?php the_title()?></span>
|
|
<button class="btn btn-danger btn-round">Купить</button>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const btns = document.querySelectorAll('.cert-items .btn')
|
|
|
|
btns.forEach(btn => {
|
|
btn.addEventListener('click', () => {
|
|
document.querySelector('.callback-modal').style.display = 'block'
|
|
})
|
|
})
|
|
</script>
|