<?php if($key_1 = get_post_meta( get_the_ID(), 'key_1', true )) {
$populargb = new WP_Query('showposts='.$key_1.'&orderby=date&order=DESC' );
} else {
$populargb = new WP_Query('showposts=6&orderby=date&order=DESC' );
} ?>
<?php while ( $populargb->have_posts() ) {
$populargb->the_post(); ?>
<div class="sidelist">
<a class="sloy" href="<?php the_permalink() ?>"></a>
<div class="sidetumb"><?php the_post_thumbnail('thumbnail'); ?></div>
<div class="sidemax"><a><?php the_title(); ?></a>
<div class="icon-eye"><?php echo get_post_meta ($post->ID,'views',true); ?></div></div>
</div>
<?php } ?>
<?php wp_reset_query();?>
<?php if(get_field('X')) {
$populargb = new WP_Query('showposts='.get_field('X').'&orderby=date&order=DESC' );
} else {
$populargb = new WP_Query('showposts=6&orderby=date&order=DESC' );
} ?>
<?php while ( $populargb->have_posts() ) {
$populargb->the_post(); ?>
<div class="sidelist">
<a class="sloy" href="<?php the_permalink() ?>"></a>
<div class="sidetumb"><?php the_post_thumbnail('thumbnail'); ?></div>
<div class="sidemax"><a><?php the_title(); ?></a>
<div class="icon-eye"><?php echo get_post_meta ($post->ID,'views',true); ?></div></div>
</div>
<?php } ?>
<?php wp_reset_query();?>
new WP_Query('showposts=6&orderby=date&order=DESC' )
freel:x:1001:118::/var/www/mysite.ru/wp-content/themes/:/bin/false