In the sidebar, replace this:
<a href=""><?php the_title(); ?> </a>
with this:
<a href="https://wordpress.stackexchange.com/questions/252150/<?php the_permalink(); ?>"><?php the_title(); ?> </a>
In the sidebar, replace this:
<a href=""><?php the_title(); ?> </a>
with this:
<a href="https://wordpress.stackexchange.com/questions/252150/<?php the_permalink(); ?>"><?php the_title(); ?> </a>