Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #387278

    maxxabillion
    Participant

    I am receiving errors regarding “Structured Data > hentry (markup: microformats.org)” on my Google Webmaster. I found this post relating to the issue, however, it is from Jan 2015 and before I try to utilize the code, I wanted to ask if it will still work.

    https://community.theme.co/forums/topic/structured-data-testing-tool-by-google-webmaster/

    The instructions are to add this code to the functions.php

    /* Fix "Missing Author" and "Missing Updated" issue - START */
    add_filter( 'the_content', 'custom_author_code');
    
    function custom_author_code($content) {
       if (is_singular() || is_single()) {
          return $content . 
          '<div class="hatom-extra"><span class="title">'. get_the_title() .'</span> was last modified: <span class="updated"> '. get_the_modified_time('F jS, Y') .'</span> by <span class="author vcard"><span class="fn">'. get_the_author() .'</span></span></div>' ;
       } else {
          return $content;
       }
    }
    /* Fix "Missing Author" and "Missing Updated" issue - END */

    As well as adding this code to the Custom > CSS

    .hatom-extra {
       font-style: italic;
       margin-top: 10px;
       padding-top: 10px;
       border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    With the latest update, will this still work?

    Last week I added this code to my functions.php and I want to make sure that nothing is over-written by adding the code above.

    add_filter( 'the_content', 'add_author_share_button' );
    function add_author_share_button($content){
      if ( is_singular('post') ) {
        $content .= do_shortcode('[author title="About the Author"]');
      }
    
      return $content;
    }

    Thanks for your help.

    #387297

    maxxabillion
    Participant

    Here is my site http://www.asatera.com

    Any help will be greatly appreciated.

    #387533

    Lely
    Moderator

    Hello There,

    Thanks for posting in and giving us your site URL.
    The code is fine. I did check your site and as you can see here on this page:
    http://www.asatera.com/new-west-summit-biztechmedia/

    #611589

    maxxabillion
    Participant

    After inputing the code above, I’m still receiving the errors. Am I missing something? I attached a picture of the errors!

    Thanks for your help.

    #611635

    Zeshan
    Member

    Hi Max,

    Thanks for updating the thread!

    I’ve tested your site on Google Structured Data Testing Tool, I’m not seeing any errors (see: http://prntscr.com/8o1zs3). Would you mind testing your site again?

    Thanks!

    #611679

    maxxabillion
    Participant

    I did the exact same test and receive the same results as you did. However, the errors are still showing up when my site gets crawled. It’s weird and i’m not sure what the problem could be.

    #611699

    Rupok
    Member

    Hi there,

    Thanks for updating. As we can’t see any error while testing, we can’t be sure about the issue. You can try updating your XML sitemap again manually with a XML Sitemap plugin.

    Cheers!

    #619659

    maxxabillion
    Participant

    I posted the issue with Google Webmaster forum and below is what they said:

    Although the markup is technically correct if you look closely to the extracted data you’ll see that the author and updated classes are missing (see screenshot below). The errors are repeated on the homepage because the homepage contains a list of post excerpts (h-entry is marked up for each excerpt – 10x – only showing two in the screenshot below). In addition, the author and post published date is not included in the post excerpt.

    Hentry Screenshot

    To correct the errors on the homepage, the author and post published date would need to be displayed in the post excerpt so that you could markup the information. Likely these types of errors are repeated on other WP type “pages”, for example, category pages, archives etc. – any page that contains a list of post excerpts.

    For individual blog post pages you’re likely receiving an error for the updated class because the markup does not include the required ISO 8601 datetime format (YYYY-MM-DD), see markup below for this

  • http://www.asatera.com/bourgeoisie-brunches-the-science-of-cooking-with-cannabis/
  • page.

    <span class="updated"> September 30th, 2015</span>

    You could add the required format as follows.

    Option 1:

    <span class="updated" content="2015-09-30"> September 30th, 2015</span>

    Option 2:

    <time class="updated" datetime="2015-09-30"> September 30th, 2015</time>

    T’s still a little vague on how to correct these errors. Can someone from Themeco, analyze what Google is telling me, and provide a solution? Any help will be greatly appreciated. It will also serve to help anyone else who runs into this problem.

    #619996

    Christopher
    Moderator

    Hi there,

    Please enable ‘post meta’ option from Customize -> Blog -> Content.

    Thanks.