Is it possible to get a page link from its slug?

Posted by Prem Tiwari | Updated on

You’re talking about Pages right? Not Posts. Is this what you looking for:

1. get_permalink( get_page_by_path( ‘map’ ) )
2. get_permalink( get_page_by_title( ‘Map’ ) )
3. home_url( ‘/map/’ )

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers