Lets say on my WordPress website I navigate to:
www.example.com/media-centre/news/17/an-example-news-post
In this case I am looking at a post in a CPT called News.
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:
www.example.com/media-centre/news/
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?
Page IDhere nothing to do with posts. The closest page in my example is/media-centre/news/, in this example I would be after thePage IDofnews. – Brady♦ Jun 29 '12 at 14:04