WordPress Infinite next and previous post looping within same category

In one one of my recent WordPress project, the client has asked me to implement infinite next and previous post looping for his ART post-type within the same category. I have found a solution and it’s working perfectly! By default WordPress shows no previous post link when someone is viewing the first post and no …