Hi Friends, In this post I will explain how to get post link by post id, I know this is not too much difficult things and also it is very small things but some time small things are hard to find so I thought to share it on my blog. Sometime while working with wordpress we need some code by which we can find post link by post id , So below I explain how we can get link of post by post id.
So to get link of post by post id there is one function get_peramlink() by which you can get post link, You can use this function in two ways, in first way you can use it in while loop and when you are using it in while loop you have to simply put this function get_peramlink() wherever you want to use this. second way is main way by which you can find link by post id, To find post link by post simply use same function and pass post id in it. Like shown below :
get_peramlink(5);
In this 5 is post id and by this way we can get post link by post id.
I am PHP Freelancer having more than 3 years of experience, So if you want to do any projects then you can contact me .