Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
The reason you get 0 back is because of the test at the end of the function: if ( ! empty( $query->posts ) && $query->is_singular ) return $query->post->ID; else return 0; The posts page doesn’t pass the is_singular test so 0 is returned. If you have a URL and want to know if it’s the … Read more