Use the following code:
<?php
if (have_posts()):
while (have_posts()):
the_post();
?>
<h5><a href="https://wordpress.stackexchange.com/questions/85120/<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<?php
if ($content != 'no') {
the_excerpt();
}
endwhile;
endif;
?>