Languages: English • 日本語 (Add your language)
Retrieves the permalink for the current page (if in The Loop) or any arbitrary page ID if passed as the first argument. All arguments are optional. All arguments default to false.
If $id is passed, it will be the id of the page whose link is returned.
$leavename can be used to toggle off the switching out of "%pagename%" in permalinks.
$sample returns a sample permalink.
<?php get_page_link($id, $leavename, $sample); ?>
This example will display a link named "Map", to page with id number 40.
<a href="<?php echo get_page_link(40); ?>">Map</a>
Page Tags: get_all_page_ids(), get_ancestors(), get_page(), get_page_link(), get_page_by_path(), get_page_by_title(), get_page_children(), get_page_hierarchy(), get_page_uri(), get_pages(), is_page(), page_uri_index(), wp_list_pages(), wp_page_menu()