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

Is there a way to add in title a date but with another color, like in iMDb titles?

Like in this title (click on it): http://www.imdb.com/title/tt1606378/

To be more clear, see this picture

The result is this:see this picture


share|improve this question
It works perfect. Thanks! There are several problems. This function changes all data on my website, it add the date time everywhere. I would like to add the date only in title. Is there a way to add/or edit data (2012) manually? Thank you very much! – Blanka Nov 1 '12 at 6:24

add this code in functions.php file

add_filter( 'the_title', 'ta_modified_post_title');
function ta_modified_post_title ($title) {
    global $post;   
    $mynewdate = strtotime($post->post_date); 
    $title = $title.'<span class="modified">'.date('Y',$mynewdate).'</span>'.'-<span class="modified">'.date('d',$mynewdate).'</span>-'.'<span class="modified">'.date('m',$mynewdate).'</span>';
  return $title;

modify date by your own way.

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.