Why does this echo values in the wrong order?

As most template tags that start with the_ this one echoes time and not returns it (which template tags that start with get_the_ do).

First the_time() fires and echoes year, then its return (null) gets concatenated and echoed with string.

So:

echo 'Archive for ';
the_time('Y');

Or:

echo 'Archive for ' . get_the_time('Y');

Leave a Comment