WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm sure there is a simple reason/answer for this: Why does

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

give me 2010Archive for? I had expected it would give me Archive for 2010

share|improve this question
up vote 6 down vote accepted

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.


echo 'Archive for ';


echo 'Archive for ' . get_the_time('Y');
share|improve this answer
Thank you! And a handy rule-of-thumb for the_function and get_the_function too, thanks :) – Amanda Dec 6 '10 at 14:22

You can also use ',' instead of '.' for concatenating strings in echo funcion.

echo 'Archive for ' , the_time('Y');
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.