Support » Fixing WordPress » Using the same tag twice

  • Resolved chrisgwynne

    (@chrisgwynne)


    I’m trying to use the_date tag twice within the loop however it doesn’t seem to be working and is just showing an empty value where it should be.

    <time datetime="<?php the_date('Y-m-d'); ?>" pubdate="pubdate"><?php the_date(); ?></time>

    It works for the time attributes but not for the content of time tag, any help?

Viewing 1 replies (of 1 total)
  • From the WordPress Codex:

    When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() with a date-specific format string.

    http://codex.wordpress.org/Template_Tags/the_date

Viewing 1 replies (of 1 total)
  • The topic ‘Using the same tag twice’ is closed to new replies.