Let's say I have a
page with the name
I can do this:
To get that page.
Now, let's say I want to get a post where the URL to that post is
If I do
get_page_by_path('post/8'); // with or without leading slash
I get back
How do I retrieve the page/post for any given URL in WP?
Edit: here's a screenshot that might add some clarity to my issue
Given the frontend permalink URL is
/post/33, how do I take that string and do the opposite? How do I take
/post/33 and get the post from that?