In addition to this site I have a personal blog जहां, amongst other things, I post recipes. I’ve recently discovered google’s new recipe search, and have been looking to implement support for microformats / microdata. Google provide a tool for checking your markup, called the “अमीर कटाव-जाते परीक्षण आईएनजी उपकरण". When I tried validating one of my recipes, I encountered various errors, which have taken me a while to track down and resolve. Each one is independent, but related, and in all cases the number of errors you are likely to encounter depends largely on the theme you use with your blog. In my case, using the mystique theme, I encountered a substantial number of errors.
1. The first problem was with the author information / hrecipe section
The solution:
You need a google profile. Your google profile must be linked from somewhere on the page, with rel=“me”, AND the main domain of your website must be listed on your google profile links.
I achieved this with the Mystique theme with a series of modifications.
सबसे पहले, I added the code from yoast (जैसा की नीचे दिखाया गया) to functions.php
[PHP]function yoast_add_google_profile( $contactmethods ) {
// Add Google Profiles
$contactmethods[‘google_profile’] = ‘Google Profile यूआरएल’;
return $contactmethods;
}
add_filter( ‘user_contactmethods’, ‘yoast_add_google_profile’, 10, 1);[/PHP]
Second, I went to my wordpress profile page and filled in the google profile field with a link to my google profile
तीसरा, I edited a line to author.php, फिर, based on information from yoast, but changed for the Mystique theme
in this section
[PHP]
अगर(($curauth->user_url<>‘https://’) && ($curauth->user_url<>")) echo ’
‘.__(‘Homepage:’,‘mystique’).’ <a href=“ ‘.$curauth->user_url.’ ”>’.$curauth->user_url.’</ए>
‘;
अगर($curauth->yim<>") echo ’
‘.__(‘Yahoo Messenger:’,‘mystique’).’ <a href=“ymsgr:sendIM?’.$curauth->yim.’ ”>’.$curauth->yim.’</ए>
‘;
अगर($curauth->jabber<>") echo ’
‘.__(‘Jabber/GTalk:’,‘mystique’).’ <a href=“gtalk:chat?jid=’.$curauth->jabber.’ ”>’.$curauth->jabber.’</ए>
‘;
अगर($curauth->aim<>") echo ’
‘.__(‘AIM:’,‘mystique’).’ <a href=“aim:goIM?screenname=’.$curauth->aim.’ ”>’.$curauth->aim.’</ए>
‘;
[/PHP]
add this extra line
[php highlight=“5”]
अगर(($curauth->user_url<>‘https://’) && ($curauth->user_url<>")) echo ’
‘.__(‘Homepage:’,‘mystique’).’ <a href=“ ‘.$curauth->user_url.’ ”>’.$curauth->user_url.’</ए>
‘;
अगर($curauth->yim<>") echo ’
‘.__(‘Yahoo Messenger:’,‘mystique’).’ <a href=“ymsgr:sendIM?’.$curauth->yim.’ ”>’.$curauth->yim.’</ए>
‘;
अगर($curauth->jabber<>") echo ’
‘.__(‘Jabber/GTalk:’,‘mystique’).’ <a href=“gtalk:chat?jid=’.$curauth->jabber.’ ”>’.$curauth->jabber.’</ए>
‘;
अगर($curauth->aim<>") echo ’
‘.__(‘AIM:’,‘mystique’).’ <a href=“aim:goIM?screenname=’.$curauth->aim.’ ”>’.$curauth->aim.’</ए>
‘;
अगर($curauth->google_profile<>") echo ’
<a href=“ ‘ . $curauth->google_profile . ’ ” rel=“me”>Google Profile</ए>
‘;
[/PHP]
आगामी, I edited single.php to add rel=“author” to the link to my author page. In the Mystique theme this is found towards the bottom of the file, within the (long) लाइन(रों) जैसा की नीचे दिखाया गया. I have added the rel=“author” at the end of the first line before the href=” part
[PHP]
printf(__(‘This entry was posted by %1$s on %2$s at %3$s, and is filed under %4$s. Follow any responses to this post through %5$s.’, ‘mystique’), ‘<a title=“ ‘. sprintf(__(“ href=“ ‘. get_author_posts_url(get_the_author_meta(‘ID’)) .’ ” rel=“author”>’. get_the_author() .’</ए>’,
get_the_time(get_option(‘date_format’)),get_the_time(get_option(‘time_format’)), get_the_category_list(‘, ’), ‘<a title=“आरएसएस 2.0″ href=“ ‘.get_post_comments_feed_link($post->ID).’ ”>आरएसएस 2.0</ए>’);echo ’ ‘;
[/PHP]
Then, finally add the same rel=“author” to line 670 of core.php
When this is correctly implemented you should get a success message in the snippets testing tool which reads Verified: Authorship markup is correct for this page
2. The second problem(रों) were with the hfeed / hentry section and included the following:
मिस आईएनजी आवश्यक hCard "लेखक".
चेतावनी दें आईएनजी: कम से कम एक क्षेत्र Hcard के लिए सेट किया जाना चाहिए.
चेतावनी दें आईएनजी: कम से कम एक क्षेत्र HatomEntry के लिए सेट किया जाना चाहिए.
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक फ़ील्ड "प्रविष्टि शीर्षक".
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक क्षेत्र "अपडेट".
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक hCard "लेखक".
समाधान(रों):
Use the wordpress editor to edit single.php
Find the code
[xhtml]</pre>
<h1 class=“title”></h1>
<pre>
[/xhtml]
replace this with…
[xhtml]</pre>
<h1 class=“title entry-title”></h1>
<h2 class=“updated”></h2>
<h2 class=“vcard”></h2>
<pre>
[/xhtml]
A final note — Don’t just copy and paste the code from this page, as for some reason (I’m guessing character encoding) it wont work. Copy it from here and paste into windows notepad. Then re-copy it from windows notepad (or any other basic plain-text-only editor) and paste into the wordpress editor. Going via notepad loses any hidden encoding or other data which causes a problem so the code is treated as the plain-text it is supposed to be
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”