Hello,
I’m making a website with infinite scrolling. When the user reaches the end, the scrollbar jumps to the top. In order to make it more natural, I have to ‘reloop’ the first 2 page-titles in the end.
My code looks like this:
Hm, maybe it recognizes the duplicates and throws them out; then you would have to loop through your original collection and then after that through $firstTwoItems (without the merge)