$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : '1';
$args = array(
'post_type' => 'test_post',
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => 3,
'meta_key' => 'short_meta_key',
'orderby' => 'short_meta_key',
'order' => 'ASC'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $post;
$sub_header_meta = get_post_meta($post->ID, 'sub_header_meta_key', true);
$short_number = get_post_meta($post->ID, 'short_meta_key', true) . " - індекс сортування";
?>
<p class="short_number"><?=$short_number; ?></p>
<h3><?php the_title()?></h3>
<p class="sub_header"><?=$sub_header_meta;?></p>
<span class="author-post"><?php the_author()?></span> <span class="date-post"><?php the_date()?></span>
<p class="excerpt"><?php the_excerpt()?></p>
<a href="<?php the_permalink()?>" class="more-link">Детально...</a>
<hr>
<?php endwhile; ?>
<?php the_posts_pagination();?>