Created
July 20, 2018 12:26
-
-
Save zohaib87/f7d5997f3780a92973271a9822cfefa7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Get url by page template | |
*/ | |
function _xe_get_page_template_url($template_name) { | |
$url = null; | |
$pages = get_pages(array( | |
'meta_key' => '_wp_page_template', | |
'meta_value' => $template_name | |
)); | |
if ( isset($pages[0]) ) { | |
$url = get_page_link($pages[0]->ID); | |
} | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment