You could make use of the WP_Query
property $current_post
$current_post
(available during The Loop) index of the post currently being displayed.
It can be used for your purpose.
You could make use of the WP_Query
property $current_post
$current_post
(available during The Loop) index of the post currently being displayed.
It can be used for your purpose.