Home › Forums › Back End › My First WordPress Theme – PHP and function output problems › Reply To: My First WordPress Theme – PHP and function output problems
There’s definitely some incorrect code in there:
echo '<h3 id="post-<?php the_ID(); ?>"><a href="';
And I suspect:
echo '<p><span><a href="author/"'; echo get_the_author_link(); echo '</span></a>'; //echo the_author(); </span></a>;
Wasn’t doing what you were expecting it to either. As far as I can tell from the documentation,
get_the_author_link() spits out the anchor tag anyway.
As you rightly acknowledge, the repeated
echos are unnecessary and make the code much harder to visualise. I’ve cleaned up the first section in a pastebin:
That should be functionally the same, although I did take the liberty of removing the malformed lines. Hopefully the problems won’t persist after you’ve applied the same principle to the rest of the code.