0

I have the following code for my date in my blogpost:

<time class="date updated" datetime="2015-10-06">
<a href="http://www.foo.de/2015/10/06/">6. Oktober 2015</a>
</time>

But the Google Structured Data Testing Tool does not recognize the datetime. What am I doing wrong?

Here is the PHP version:

<time class="date updated" datetime="<?php the_time('Y-m-d'); ?>">
        <a href="<?php echo get_day_link( get_the_time('Y'),
        get_the_time('m'), get_the_time('d')); ?>">
        <?php echo get_the_date() ?>
        </a>
</time>

Here comes more: This is the part in single.php where the Date and other metadata gets loaded.

<header class="topinfo animated" data-anim="fadeInDown">
    <h1 title="<?php the_title() ?>" class="entry-title"><?php the_title() ?></h1>
    <?php get_template_part('part', 'textinfo') ?>
</header>

This is the file where the date and the metadata come from

<?php if( ( !is_page() and $iw_opt['single-date'] ) or ( is_page() and $iw_opt['page-date'] ) ) : ?>
    <li>
        <time class="date updated" datetime="<?php the_time('Y-m-d'); ?>">
        <a href="<?php echo get_day_link( get_the_time('Y'), get_the_time('m'), get_the_time('d')); ?>">
        <?php echo get_the_date() ?>
        </a>
        </time>
    </li>
<?php endif; ?>
  • Could you provide a minimal example of the full Microformat snippet? – unor Oct 7 '15 at 16:45
  • hey unor, i added some more code :) – moesphemie Oct 8 '15 at 7:16
  • But that’s not the full Microformat, is it? For example, the top class (hentry) seems to be missing? Anyway, it should suffice to show us your actual HTML markup, not the PHP which generates it. – unor Oct 8 '15 at 7:25
  • and sharing the URL helps too :) – Simon Hayter Oct 8 '15 at 8:04
  • Okay okay: here you go: blog-der-republik.de/… :p I know the title is ultra long, but the authors are all sensible "artists" and don't want to listen to us… I know it's lame but you have to know i can't to so much changes here, because i'm a little webdesigner fresh from the university haha – moesphemie Oct 8 '15 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.