سلام خدمت دوستان عزیز ،
بنده قصد شماره گذاری پست های یک دسته رو داشتم و با استفاده از کد زیر اونو انجام دادم
function Get_Post_Number($postID){
$temp_query = $wp_query;
$args = array (
'orderby' => 'date',
'order'=> 'DESC',
'post_type' => 'post',
'posts_per_page' => '-1' );
$counter = 1;
$postCount = 0;
$AVRank = null;
$AVRank = new WP_Query($args);
if($AVRank->have_posts()) {
while ($AVRank->have_posts()) : $AVRank->the_post();
if ($postID == get_the_ID()){
$postCount = $counter;
} else {
$counter++;