Is it possible to get a page’s permalink from the slug alone? I’m aware that you can get the page’s permalink from the ID using get_page_link()
:
<a href="https://wordpress.stackexchange.com/questions/4999/<?php echo get_page_link(40); ?>">Map</a>
I’m curious if there is any way to do the same with the slug of a page – like this:
<a href="https://wordpress.stackexchange.com/questions/4999/<?php echo get_page_link("map'); ?>">Map</a>
Is this what you are looking for:
get_permalink( get_page_by_path( 'map' ) )
get_permalink( get_page_by_title( 'Map' ) )
home_url( '/map/' )