Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #878980
    peterjitg@yahoo.com
    Participant

    Hello,

    I’m on Ethos, my domain is updato .com.

    Looking at my WMT, I have thousands of these errors under Search Appearance > Structured Data. Looked around but none of the information out there worked for me.

    Please assist.

    #879360
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

    Please try to add this code in your child theme’s 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 hidden"><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;
       }
    }
    // =============================================================================

    Let us know how it goes.

    Thanks.

    #880267
    peterjitg@yahoo.com
    Participant

    Hello,

    Where do I find functions.php in X theme so that I can copy it over to child? I don’t see it in framework/views/ethos. Should I just grab the one from /x?

    Thanks

    #880798
    Prasant Rai
    Moderator

    Hello Peter,

    Thanks for updating the thread!

    Please download and install child theme from https://community.theme.co/child-theme/. Once you install the child theme click on Appearance > Editor > function.php.

    http://prntscr.com/arwf8k

    You can also use FTP to edit files. To do that navigate to wp-content/themes/x-child and open function.php file.

    Thanks.

    #884759
    peterjitg@yahoo.com
    Participant

    Great, thanks. Done. I’ll keep an eye out on WMT and keep you posted. Hope this helps.

    #885553
    Christopher
    Moderator

    You’re welcome.

    #885937
    simplefit
    Participant

    hello! thank you for this forum. after implementing both css and functions.php files, i notice that the results are visible on the page ..

    is there a way of implementing this fix without the results being posted at the bottom of every page – it looks horrible to have the results posted on pages. thank you kindly!

    #885941
    simplefit
    Participant

    it looks like you may have provided the solution (“hatom-extra hidden”), please let me know if this is the correct solution to my challenge. thank you kindly!

    #886620
    Thai
    Moderator

    Hi @simplefit-2,

    Please update the previous code a bit:

    // Fix "Missing Author" and "Missing Updated" issue - START
    // =============================================================================
    add_filter( 'the_content', 'custom_author_code');
    
    function custom_author_code($content) {
       if ( is_singular('post') ) {
          return $content . 
          '<div class="hatom-extra hidden"><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;
       }
    }
    // =============================================================================

    Hope it helps 🙂

    #890506
    peterjitg@yahoo.com
    Participant

    Hi,

    So after implementing the code on the 15th, I’ve noticed a slight drop in errors starting from the 16th. But no where near down to zero. The drop is minimal. Also, it shows that an error was “last detected” on the 17th. So I think the errors are still coming in.

    #891491
    Jack
    Keymaster

    Hi there,

    Thanks for writing back! Was it the original code supplied that you added? Can you try with this updated code please?

    // Fix "Missing Author" and "Missing Updated" issue - START
    // =============================================================================
    add_filter( 'the_content', 'custom_author_code');
    
    function custom_author_code($content) {
       if ( is_singular('post') ) {
          return $content . 
          '<div class="hatom-extra hidden"><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;
       }
    }
    // =============================================================================
    

    Thanks!

    #892086
    peterjitg@yahoo.com
    Participant

    Okay, will try and report back in a couple of days. Thank you.

    #892878
    Prasant Rai
    Moderator

    Let us know how it goes.

    Thanks.

    #895609
    peterjitg@yahoo.com
    Participant

    Okay, not much has changed. When I first added the code (the first version), it dropped from 3700 errors to about 2900. It has since plateaued, and the new script didn’t seem to have any impact at all.

    #896721
    Rad
    Moderator

    Hi there,

    Is there a way you can provide all the error? I checked it here https://developers.google.com/structured-data/testing-tool/ but looks okay.

    It could be related to multiple instances of hentry with no valid data within it. WordPress uses post_class() for outputting classes to elements and by default hentry is part of it. And google always expects rich data for each entry. I’m not sure, though, need to confirm it from the error you’re getting.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-878980 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>