Formatting WordPress the_date or get_the_date for HTML5 time tag (datetime attribute)

This is how you format post dates for the datetime attribute of the HTML5 <time> tag:

<time datetime="<?php the_date('Y-m-d\TH:i'); ?>"><?php the_date(); ?></time>

2 thoughts on “Formatting WordPress the_date or get_the_date for HTML5 time tag (datetime attribute)

  1. priligy 60 mg In the United States all states and counties that permit the sale of alcohol allow privatized retail sales of beer and most allow privatized retail sale of all alcoholic beverages

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>