WordPress.org

Forums

Ridizain
[resolved] Google structured data for authoring error (4 posts)

  1. josemiguelgil
    Member
    Posted 1 year ago #

    Hi Zulficar! And Thanks for this awesome theme!

    I've set up my web and Google+ account following Google instructions so that Google Authoring works properly, but when I check it out using Google Structured Data Testing Tool, I get two errors:
    Error: Missing required field "updated".
    Error: Missing required hCard "author".

    Googling that errors, I came across this workaround:
    In single.php
    Change "<span class="post_date"><?php the_time('j F,Y'); ?></span>" for "<span class="post_date date updated"><?php the_time('j F,Y'); ?></span>"
    AND
    Change "<span class="theauthor"><?php the_author_posts_link(); ?></span>" for "<span class="vcard author"><span class="fn"><?php the_author(); ?></span></span>"

    But I can not find those lines of code in single.php.

    Where could I change them?

    Thank you very much!

    Jose Miguel

  2. Zulfikar Nore
    Member
    Theme Author

    Posted 1 year ago #

    Hello Jose,

    You are most welcome and thank you for using Ridizain.

    First of all let me start by saying the advice given on that link is bad advice! By directly editing theme files you risk loosing your edits each time the theme is updated.

    The advice should be to use a plugin to add those elements if at all possible and if not then the next best thing is to use a child theme.

    OK, now on to the edits

      The date: the_time('j F,Y') is a standard output as part of WordPress core depending on user settings which can differ greatly.

    So we developer use get_the_date() function to retrieve the date format in themes with an entry-date class.

      The Author: class="vcard author"

    This is included in the theme as class="author vcard" followed by class="url fn n" class so not sure why you'd get an error on that unless Google specifically requires that to be class="vcard author" and just class="fn"?

    You can find these in the file template-tags.php located in the inc folder of the theme.

    Hope that helps point you in the right direction.

    Regards,
    Zulf

  3. josemiguelgil
    Member
    Posted 1 year ago #

    Hi Zulf! Thanks for the reply.

    First of all, you're right about using a child theme. I toke it for granted when I posted, but should have made it explicit :)

    Regarding your suggestion, I'll will give it a try.

    However, I have tested two other websites that I run against Google Structured Data Testing Tools and got the same errors, so although it could be a "theme related error", we should not blame it on Ridizain especifically, because I use different themes on the other sites.

    I'll give you any feedback should I get to a fix for this.

    All the best!

    Jose

  4. Zulfikar Nore
    Member
    Theme Author

    Posted 1 year ago #

    I'll give you any feedback should I get to a fix for this.

    That will very much be appreciated, thank you - and likewise, if I come up with a solution will be sure to share it :)

    I'll be sure to look in to how that tool works and see what fixes can be done in this theme and implemented in future themes.

    Closing thread as resolved for now but feel free to open a new if the need be.

    Regards,
    Zulf

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic