Lets say on my WordPress website I navigate to:
In this case I am looking at a post in a CPT called
What I want to do is get the page ID thats closest to that URL. I know the closest page ID can be found at:
So how do I loop back over my URL to find the closest page and then how do I get the ID of that page?