// ACTIVE ITEM OF MENU
$(window).scroll(function () {
var $sections = $('.section');
$sections.each(function (i, el) {
var top = $(el).offset().top - 0;
var bottom = top + $(el).height();
var scroll = $(window).scrollTop();
var id = $(el).attr('id');
if (scroll > top && scroll < bottom) {
$('.header_items a.active').removeClass('active');
$('.header_items a[href$="' + id + '"]').addClass('active');
}
})
});
$(document).ready(function() {
if ($(window).width() < 768) {
if (localStorage.getItem("modal") != "off") {
$("#mobile").show();
}
$("#mobile span").click(function() {
$("#mobile").hide();
localStorage.setItem("modal", "off");
});
}
});
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'slicks',
'posts_per_page' => 1,
'paged' => $paged
);
$loop = new WP_Query($args);
while ($loop->have_posts()):
$loop->the_post();
?>
<?php
the_meta();
the_title();
the_field('b-slider-photo');
?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>