I am trying to get a link together using 2 variables but the output is the link and title but no html / clickable link appearing.
I'm getting something link this:
http://www.mydomain.com/post1/post_title_here
Here is the code:
echo '<a href="'.the_permalink().'">'.the_title().'</a>';
Can anyone help please?
Thanks
UPDATE:
Here's the whole block of code:
<div id="MyBlock1">
<?php
$query = new WP_Query('posts_per_page=5');
while( $query ->have_posts() ) : $query ->the_post();
echo '<li>';
echo '<a href="'.the_permalink().'">'.the_title().'</a>';
echo '</li>';
endwhile;
wp_reset_postdata();
?>
</div>
the_permalink()?the_function()sends the output directly to the client, whileget_the_function()returns its output instead.