I have a syntax question: How can I use a PHP variable inside the previous_post_link function?e.g.
<?php previous_post_link('%link','<div class="previous-post"><h3>'. echo $variable ;'</h3></div>'); ?>
You don’t need to echo anything, that is made by the function.
<div class="previous-post"><h3>'. $variable .'</h3></div>