$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$parent = new WP_Query( $args );
if ( $parent->have_posts() ) : ?>
<?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
<article>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php the_post_thumbnail(); ?>
<?php the_excerpt(); ?>
<div class="page-content"><?php the_content(); ?></div>
</article>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
onLeave: function(index, nextIndex, direction){
if(index == 2){
var magnificPopup = $.magnificPopup.instance;
magnificPopup.close();
}
}
if (window.matchMedia('(max-width : 992px)').matches) {
//Пишем то что нужно
}