Erreur : Missing required field

  • Author
    Posts
  • #28315
    Valérie

    Hello,

    In the Google Structured Data in Google Webmaster Tools, I get the errors :

    Erreur : Missing required field “entry-title”.
    Erreur : Missing required field “updated”.
    Erreur : Missing required hCard “author”.

    Does anyone knows how to modify the Mantra theme to avoid the errors ?

    Thank you !

    Valérie
    (France)

    #28318
    Bebs
    #28336
    Valérie

    Hi Bebs !

    Really thank you for your message !

    You really helped me.

    I added the functions indicated in functions.php and now the “Missing required field “updated”” and “Missing required hCard “author”” errors are corrected 🙂

    Unfortunately, I still have the “Missing required field “entry-title”” error and I don’t know why…

    If, by chance you (or someone else) know how to correct this…

    Anyway, thank you again !

    #28348
    Valérie

    My home page had no title that’s why the “Missing required field “entry-title”” error was still present. Now everything work fine !

    #29341
    Walter

    Hi Valerie and Bebs, did you add the code suggested to the functions.php file and it worked the same day?

    I tried adding the code found on the page below right after <?php on Parabola: Theme Functions (functions.php)

    http://www.davidtiong.com/fix-hatom-microformats-at-least-one-field-must-be-set-for-hatomentry/

    Checked again on google webmaster and didn’t work.

    Am I doing something wrong here?

    Thank you

    #29368
    Valérie

    Hi Walter !

    Yes, I add the code in the functions.php et it worked the same day (immediately).

    I use a child theme, so I created the file functions.php in my child theme directory and here is the full content of my file :

    <?php
    //mod content
    function hatom_mod_post_content ($content) {
      if ( in_the_loop() && !is_page() ) {
        $content = '<span class="entry-content">'.$content.'</span>';
      }
      return $content;
    }
    add_filter( 'the_content', 'hatom_mod_post_content');
     
    //add hatom data
    function add_mod_hatom_data($content) {
        //$t = get_the_modified_time('F jS, Y');
        $t = get_the_modified_time('d/m/Y');
        $author = get_the_author();
        $title = get_the_title();
          if ( is_single() || is_page()) {
            $content .= '<div class="hatom-extra"><span class="entry-title">'.$title.'</span> a &eacute;t&eacute; modifi&eacute; le <span class="updated"> '.$t.'</span> par la <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
        }
        return $content;
        }
    add_filter('the_content', 'add_mod_hatom_data');
    
    // $content .= '<div class="hatom-extra"><span class="entry-title">'.$title.'</span> a &eacute;t&eacute; modifi&eacute; le <span class="u//pdated"> '.$t.'</span> par la <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
    ?>
    

    Be carefull, I changed the date format in order to be printed as a French date format but, maybe it can help you to see how to integrate the code in your functions.file…

    Good luck and I hope that you can find the problem.

    Valérie

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Erreur : Missing required field’ is closed to new replies.