• Resolved options-trading-guy

    (@options-trading-guy)


    In order to clear the missing: updated structured data error in Google WMT, open functions.php and find the function:
    kippis_posted_on()

    and look for the time class code. Add the date updated text to the class as shown below. Cures the date updated error in Google WMT structured data.

    <time class="entry-date date updated" datetime="%4$s" pubdate>%5$s</time>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter options-trading-guy

    (@options-trading-guy)

    Can remove the date from “…date updated”

    code should read:
    <time class="entry-date updated" datetime="%4$s" pubdate>%5$s</time>

    Also at the end of the content.php file, just before the /footer you can add the following code to clear the date updated error on individual pages (not categories or tags, but individual static content pages).

    <?php if ('page' == get_post_type()) : ?>
                    <div class="entry-meta">
                      <?php kippis_posted_on(); ?>
                    </div><!-- .entry-meta -->
                  <?php endif; ?>
    Thread Starter options-trading-guy

    (@options-trading-guy)

    The original solution I presented above doesn’t correctly add the modified date for structured data purposes – and should be ignored. A slight rewrite of the kippis posted on function is needed (see below):

    if (!function_exists('kippis_posted_on')) {
    function kippis_posted_on()
    {
      global $kippis_options;
      $show_author = $kippis_options['kippis_posts_author_enable'] == 'on';
      $show_date   = $kippis_options['kippis_posts_date_enable'  ] == 'on';
      if ($show_author || $show_date) {
        printf('<span class="sep">%1$s</span>'
             . '<a href="%2$s" title="%3$s" rel="bookmark"><time class="entry-date" datetime="%4$s" pubdate>%5$s</time></a> (<em class="entry-date updated">modified %10$s</em>)'
             . '<span class="by-author"> <span class="sep">%6$s</span> <span class="vcard author">'
             . '<a class="url fn n" href="%7$s" title="%8$s" rel="author">%9$s</a>'
             . '</span></span>'
          ,($show_date   ? __('Posted on','kippis') . ' '                                         : '')
          ,($show_date   ? esc_url (get_permalink())                                              : '')
          ,($show_date   ? esc_attr(get_the_time())                                               : '')
          ,($show_date   ? esc_attr(get_the_date('c'))                                            : '')
          ,($show_date   ? esc_html(get_the_date())                                               : '')
          ,($show_author ? ' ' . __('by','kippis') .' '                                           : '')
          ,($show_author ? esc_url (get_author_posts_url(get_the_author_meta('ID')))              : '')
          ,($show_author ? sprintf (esc_attr__('View all posts by %s','kippis'),get_the_author()) : '')
          ,($show_author ? esc_html(get_the_author())                                             : '')
          ,($show_date   ? esc_html(get_the_modified_date())                                      : '')
        );

    You will still need to modify the end of the content.php file as below:

    <?php if ('page' == get_post_type()) : ?>
                    <div class="entry-meta">
                      <?php kippis_posted_on(); ?>
                    </div><!-- .entry-meta -->
                  <?php endif; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Google WMT Structured data fix’ is closed to new replies.