How to get WordPress page url by id

to get the URL of any post or page in WordPress first you need to get the id of that page or post, and for that go to admin panel and open the post or page for edit and on URL you will find ?post= and get the post or page id from there.

Now Keep the page or post id in a variable
Example:
$post_id = 40;

Then call the function get_page_link() and pass the post id through the function and print it and you will get the id

Now here is the full code



Thanks for Reading

Share The Post On -

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.