Get Permalink by Page title or slug

Usually we grab a page Permalink through page ID but sometimes we had a case to grab Permalink through Page Slug or Page Title, So Below are the easiest way to grab the permalink for a page through page title or page slug.

 get_permalink( get_page_by_path( 'case-studies' ) );  
 get_permalink( get_page_by_title( 'Case Studies' ) );

Leave a Reply

Your email address will not be published. Required fields are marked *