microformats2 time class=“dt-published“ or dt-updated wordpress in ISO 8601

von Joern am 28. Feb. 2015 | Keine Kommentare

In WordPress you get the time and date by using Time posted: <?php the_time(); ?> for the publishing date or if you want to get the date for Last modified use <?php the_modified_time(); ?>

to get these values in time format ISO 8601 you simply use ‚c‘ inside The brackets:


<?php the_time('c'); ?>


<?php the_modified_time('c'); ?>

for microformats I use:


<time class="entry-date published dt-published" datetime="<?php the_modified_time('c') ?>"></time>

for <article itemscope itemtype="http://schema.org/Article" .. I use


<a href="<?php the_permalink(); ?>" class="entry-date published updated"><span itemprop="datePublished" content="<?php the_time('c') ?>"><?php echo get_the_date(); ?></span></a>

you find me on Google+, Twitter and Facebook

(von: Joern)

Sorry, no posts matched your criteria.


Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

weitere forum Beiträge: