Created
October 11, 2012 16:22
-
-
Save simonsmith/3873578 to your computer and use it in GitHub Desktop.
Get Wordpress page by title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves a link to a page via page title | |
* | |
* @param $title | |
* @return string | |
*/ | |
function get_permalink_by_title($title) { | |
return get_permalink(get_page_by_title($title)->ID); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment