I’m currently working on a WordPress website for the first time, in one of my views I load content dynamically via AJAX, but this information doesn’t include the permalink for the posts I load. I wanted to know how I can get the permalink for a post via AJAX by providing the post ID.
Share
This WordPress function returns the permalink for a given ID.
get_permalink()
Back-end:
Front-end: