const sliderOptions = {
arrows: true,
dots: false,
variableWidth: true,
centerMode: true,
slidesToShow: 8,
autoplay: true,
autoplaySpeed: 2000,
slidesToScroll: 3,
nextArrow: '<div class="tags__arrow tags__arrow_next">',
prevArrow: '<div class="tags__arrow tags__arrow_prev">',
appendArrows: $('.tags__arrows'),
}
const sliderSet = (is_on) => {
if (is_on) {
$('.tags__option_on').hide();
$('.tags__option_off').show();
$('.tags__inner').slick(sliderOptions);
} else {
$('.tags__option_on').show();
$('.tags__option_off').hide();
$('.tags__inner').slick('unslick');
}
}
$('.tags__option_on').on('click', () => sliderSet(true));
$('.tags__option_off').on('click', () => sliderSet(false));
sliderSet(false); // начальное состояние
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
if (window.innerWidth < 768) {
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.src = 'mob.js';
document.head.appendChild(script);
}
});
</script>
$("form").find('.success').css('display': 'block')
document.getElementById('overlay').style='visibility:hidden;opacity:0;transition:all 0.7s ease-out 0s';
paginate_links()
, возьмите код отсюда: Как добавить пагинацию для страниц или cpt с испол... $pc = new WP_Query('cat=14&orderby=date&posts_per_page=3');
$iPc = 1;
while ($pc->have_posts()) :
$pc->the_post();
newsListElem('h'.$iPc);
$iPc++;
endwhile;
// Элемент списка новостей
function newsListElem($heading = 'no') { ?>
<article class="news-block">
<?=get_illPicture($id, 'mini', 'news-block__img')?>
<div class="news-block__content">
<time class="news-block__time"><?=get_the_date()?></time>
<a href="<?php the_permalink(); ?>" class="news-block__title"><?=(($heading === 'h1') ? '<h1 class="news-block__title_heading">' : '').nobrArticle(get_the_title()).(($heading === 'h1') ? '</h1>' : '')?>
<?php $thisImg = get_field('post-file-other', get_the_ID());
if ($thisImg !== false): ?>
<img class="news-block__title_img" src="<?=$thisImg['url']?>" alt="<?=$thisImg['alt']?>">
<?php endif; ?>
</a>
<div class="news-block__wraptext">
<div class="news-block__text">
<?php if ($shortDesc = get_field("post-shortdesc", get_the_ID())): ?>
<?=processingText($shortDesc)?>
<?php else: ?>
<?=processingText(get_the_content())?>
<?php endif; ?>
</div>
</div>
<a href="<?php the_permalink(); ?>" class="news-block__button">Подробнее</a>
</div>
</article>
<?php }