get url by id wordpress code example
Example 1: get wordpress page link by id
echo get_page_link($page_id);
Example 2: wordpress get link to post by id
get_permalink();
Example 3: wordpress get link
<a href="<?php the_permalink(); ?>">
Example 4: get id by url wordpress
// https://developer.wordpress.org/reference/functions/url_to_postid/
url_to_postid( string $url )