Want to get page id of a page using page slug in WordPress? Add the following code to the functions.php file of your current activated WordPress theme.
$page = get_page_by_path( 'about' );
echo get_the_title( $page );
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.