$args=array(
'category__in' => $cat_ID,
'orderby'=>data,
'paged' => $paged,
'caller_get_posts'=>1);
$my_query = new wp_query($args);
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("paged=$page&cat=1");
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) {
$my_query->the_post(); ?>
<?php $cat2 = get_query_var('cat');
$category = get_category ($cat2);?>
<div class="category-result-post">
<div class="category-news-post-img">
<a href="<?php echo get_permalink($post->ID); ?>">
<?php if(get_the_post_thumbnail_url($post->ID)) echo get_the_post_thumbnail($post->ID); else echo ' <img alt="#" src="http://blogprogram.ru/wp-content/uploads/2016/05/noimg.png">';?>
</a>
</div>
<div class="category-result-detail">
<div class="category-result-detail-body">
<p class="date-news"><?php the_time( 'd.m.Y'); ?></p>
<div class="category-result-post-bottom">
<p class="posts-p"><a href="<?php echo get_permalink($post->ID); ?>" class="news-post-text"><?php echo $post->post_title; ?></a></p>
</div>
</div>
</div>
</div>
<?php }
} else {
echo('<p>Извините, нет записей.</p>');
}
wp_reset_query();
?>
<!-- --><?php //the_posts_pagination();?>
</div>