get_permalink by page id code example
Example 1: wordpress get_permalink
// Get post permalink (you can use it inside a wp_query loop)
<?php the_permalink(); ?>
// or
<?php $link = get_the_permalink(); ?>
Example 2: get wordpress page link by id
echo get_page_link($page_id);
Example 3: wordpress get link
<a href="<?php the_permalink(); ?>">