How to get page id of a page using page slug?

Posted by Editorial Staff | Updated on |

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.

Use get_page_by_path($page_path):


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.

Related Questions & Answers