// Get post permalink (you can use it inside a wp_query loop)
<?php the_permalink(); ?>
// or
<?php $link = get_the_permalink(); ?>
// outside the loop:
<?php echo get_permalink( $post->ID ); ?>
<?php
if(count($related)) {
echo "<div>Read More<ul>";
foreach($related as $id) {
echo '<li><a href="'.get_permalink( $id ).'">'.get_the_title( $id ).'</a></li>';
}
echo "</ul></div>";
}
?>
<a href="<?php the_permalink(); ?>">permalink</a>
// Get shortlink (short permalink)
<?php echo wp_get_shortlink(); ?>