The point of this script is to show last added 12 photos (thumbs of it). And this works perfect. But I want to add second funcionality – link to the page where it comes from (usually native gallery embed into post/page)
The problem is that in this case the link is corrupted. It always links to the very first post. What I am doing wrong?