I'm searching for posts this way
$args = array( 'name' => $permalink, 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => 1 ); $posts = get_posts( $args );
This works great for "page1" and "foo/page2" when I put "page1" and "page2" respectively in
How can I craft a query to work for the case with where I want to search for "foo/page2"?
edit i want to get the post object so that I can retrieve some data from it.