There is such a loop in WP:
<?php /*Start the loop*/ ?> <?php $specialistquery = new WP_Query('category_name=our-specialists'); ?> <?php while ( $specialistquery->have_posts()) : $specialistquery->the_post()?> <div class="full-info clear"> <?php the_post_thumbnail(); ?> <p class="name visible"><?php the_title() ?></p> <div class="post-content"> <?php get_template_part( 'template-parts/content' ); ?> <img class="close-full" src=""> </div> <p class="specialization visible"><?php echo get_post_meta($post->ID, 'specialization', true) ?></p> <p class="education visible"><?php echo get_post_meta($post->ID, 'education', true) ?></p> <p class="experience visible">Стаж более 25 лет</p> </div> <?php endwhile; ?> <script type="text/javascript"> $(document).ready(function(){ $('.specialist-content').on('click','.full-info',function(){ $(this).find('.post-content').css({'display':'inline','background':'#f1f5f5'}); $(this).find('.specialization').css({'display':'none'}); $(this).find('.education').css({'display':'none'}); $(this).find('.experience').css({'display':'none'}); $(this).find('.attachment-post-thumbnail').css({'margin':'0 30px 25px 0','width':'300px','height':'300px'}); }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $('.specialist-content').on('click','.close-full',function(){ $(this).find('.post-content').css({'display':'none','background':'none'}); $(this).find('.specialization').css({'display':'inline'}); $(this).find('.education').css({'display':'inline'}); $(this).find('.experience').css({'display':'inline'}); $(this).find('.attachment-post-thumbnail').css({'margin':'0','width':'300px','height':'300px'}); }); }); </script>
$('.<?php echo get_the_ID() ?>')in the console? - Poniotype=\"text/javascript\"withtype="text/javascript"and earned. Removed extra slashes - Mr. Black