I'm working on a theme with CPT. In single-cpt.php, I want to show the post number out of the total posts.
I managed to show the total ok posts using :
<?php $args = array(
'post_type' => 'cpt_type',
'post_status' => 'published',
'numberposts' => -1
);
echo $num = count( get_posts( $args ) ); ?>
and it returns the total of posts for that CPT type. So, on each single cpt, I got the total number.
What I would like, is to have "post number" / "total posts". Example : 7/21, and when I go o the following post : 8/21 and so on...
So, how could I get each single post to have a "number"?
Thanks!