I was trying to get the index number of the posts which belong to a specific category. I tried to create a shortcode to achieve that but no luck, it returns “1” for all posts.
Any help would be appreciated.
Note: I’m using this shortcode [mycategory_post_index] in a layer of Post Based Revslider. The frontend result should be like “3” which means: the 3rd (3rd post in descending order) post in that specific category.
The solution over Revslider API:
By the way, there is another solution based on Revslider API, someone might need it, so I am sharing for good.
This goes to rev slider custom js console.
then you add “slide-status-numbers” class name into your layer attributes.