go41

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:

Code:

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

or
Code:

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

for microformats I use:

Code:

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

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

Code:

<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.

Autor:

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

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: