If I set Reading Settings > Posts Page (in other words, the page_for_posts
option) to a static page, and then attempt to pass its URL through url_to_postid()
it will return 0
– why is it?
I understand that it’s technically no longer a static/post page, but is the posts page, however that page still has an ID and I still need to get at it. Funny enough, I need to get the ID in order to test if it is the same value as page_for_posts
. I can’t use the 0
returned from the url_to_postid function because 0 can be returned for a number of reasons.
Does anyone know how I can test the current URL to get its ID, when it’s set to the page_for_posts
page?