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.
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
function yoast_add_google_profile( $contactmethods ) { // Add Google Profiles $contactmethods['google_profile'] = 'Google Profile URL'; return $contactmethods; } add_filter( 'user_contactmethods', 'yoast_add_google_profile', 10, 1);
Second, I went to my wordpress profile page and filled in the google profile field with a link to my google profile
Third, I edited a line to author.php, फिर, based on information from yoast, but changed for the Mystique theme
in this section
if(($curauth->user_url<>'http://') && ($curauth->user_url<>'')) echo ' '.__('Homepage:','mystique').' <a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a> '; if($curauth->yim<>'') echo ' '.__('Yahoo Messenger:','mystique').' <a href="ymsgr:sendIM?'.$curauth->yim.'">'.$curauth->yim.'</a> '; if($curauth->jabber<>'') echo ' '.__('Jabber/GTalk:','mystique').' <a href="gtalk:chat?jid='.$curauth->jabber.'">'.$curauth->jabber.'</a> '; if($curauth->aim<>'') echo ' '.__('AIM:','mystique').' <a href="aim:goIM?screenname='.$curauth->aim.'">'.$curauth->aim.'</a> ';
add this extra line
if(($curauth->user_url<>'http://') && ($curauth->user_url<>'')) echo ' '.__('Homepage:','mystique').' <a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a> '; if($curauth->yim<>'') echo ' '.__('Yahoo Messenger:','mystique').' <a href="ymsgr:sendIM?'.$curauth->yim.'">'.$curauth->yim.'</a> '; if($curauth->jabber<>'') echo ' '.__('Jabber/GTalk:','mystique').' <a href="gtalk:chat?jid='.$curauth->jabber.'">'.$curauth->jabber.'</a> '; if($curauth->aim<>'') echo ' '.__('AIM:','mystique').' <a href="aim:goIM?screenname='.$curauth->aim.'">'.$curauth->aim.'</a> '; if($curauth->google_profile<>'') echo ' <a href="' . $curauth->google_profile . '" rel="me">Google Profile</a> ';
आगामी, 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) line(एस) जैसा की नीचे दिखाया गया. I have added the rel=“author” at the end of the first line before the href=” part
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() .'</a>', get_the_time(get_option('date_format')),get_the_time(get_option('time_format')), get_the_category_list(', '), '<a title="RSS 2.0" href="'.get_post_comments_feed_link($post->ID).'">RSS 2.0</a>');echo ' ';
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
</pre> <h1 class="title"></h1> <pre>
replace this with…
</pre> <h1 class="title entry-title"></h1> <h2 class="updated"></h2> <h2 class="vcard"></h2> <pre>
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
अपना खुद का कुछ विचारों को समझे? खुद टिप्पणी से नीचे लिप्त! आप सदस्यता के लिए चाहते हैं, तो ऊपर दाईं ओर मेनू पर लिंक का उपयोग करें सदस्यता लें. आप नीचे दिए गए सामाजिक लिंक का उपयोग करके अपने दोस्तों के साथ इस साझा कर सकते हैं. चियर्स.
उत्तर छोड़ दें