$(function() {
$('.interests__item').click(function(){
if ( $('.interests__item_active').length < 5 )
$(this).toggleClass('interests__item_active');
else if ($(this).hasClass('interests__item_active'))
$(this).toggleClass('interests__item_active');
});
$('.interests__item').click(function(){
if ( $('.interests__item_active').length >= 5 )
$('.interests__item').addClass('interests__item_confirmed');
else {
$('.interests__item').removeClass('interests__item_confirmed');
}
});
});
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
if ( $wp_query->current_post == 0 ) :
get_template_part( 'hero' );
endif;
endwhile;
endif;
?>
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
if ( $wp_query->current_post > 0 ) :
get_template_part( 'article' );
endif;
endwhile;
endif;
?>