What PHP code can be used to retrieve the current page name in a WordPress theme?
All the solutions I have seen so far:
the_title()get_page()->post_name
get_post()
etc.
But these don't work for a page that contains post entries. They will all return the name of the latest blog entry.
Stated another way, assume that you have a page created in WordPress with the name "My News". This page is set as the "post page". Add a couple of posts to the page. Now, what API can be used to retrieve the string "my-news" instead of the name of the latest post?
Please login or Register to submit your answer
Very poor demo of the features
Wahts
Demo text