I want to echo a PHP function with some string literal HTML.
This is how I thought it was done:
echo '<a href="' + $prevpost->url() + '" class="postnav left nextpost"></a>';
...but that returns nothing. I've tried small variations on where the quotes are etc. but I'm worried I'm barking up the wrong tree and I can't really find what I need from searching.
Note: echo $prevpost->url();
does return the URL I am trying to link to, before anybody asks if that works.