DIY मीडिया होम लोगो

अपनी खुद की होम थिएटर और हाय-Fi सेटअप डिजाइन और बनाने के लिए परम साइट.

0Wordpress लोगोRich Snippets code for Mystique 2.x

In addi­tion to this site I have a per­son­al blog जहां, amongst oth­er things, I post recipes. I’ve recently dis­covered google’s new recipe search, and have been look­ing to imple­ment sup­port for micro­formats / microdata. Google provide a tool for check­ing your markup, called the “अमीर कटाव-जाते परीक्षण आईएनजी उपकरण". When I tried val­id­at­ing one of my recipes, I encountered vari­ous errors, which have taken me a while to track down and resolve. Each one is inde­pend­ent, but related, and in all cases the num­ber of errors you are likely to encounter depends largely on the theme you use with your blog. In my case, using the mys­tique theme, I encountered a sub­stan­tial num­ber of errors.

1. The first prob­lem was with the author inform­a­tion / hrecipe section

The solu­tion:

You need a google pro­file. Your google pro­file must be linked from some­where on the page, with rel=“me”, AND the main domain of your web­site must be lis­ted on your google pro­file links.

I achieved this with the Mys­tique theme with a series of modifications.

सबसे पहले, I added the code from yoast (जैसा की नीचे दिखाया गया) to functions.php

[PHP]function yoast_add_google_profile( $con­tact­meth­ods ) {
// Add Google Profiles
$contactmethods[‘google_profile’] = ‘Google Pro­file यूआरएल;
return $con­tact­meth­ods;
}
add_filter( ‘user_contactmethods’, ‘yoast_add_google_profile’, 10, 1);[/PHP]

Second, I went to my word­press pro­file page and filled in the google pro­file field with a link to my google profile

तीसरा, I edited a line to author.php, फिर, based on inform­a­tion from yoast, but changed for the Mys­tique 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 Mys­tique theme this is found towards the bot­tom of the file, with­in the (long) लाइन(रों) जैसा की नीचे दिखाया गया. I have added the rel=“author” at the end of the first line before the href=” part

[PHP]
printf(__(‘This entry was pos­ted by %1$s on %2$s at %3$s, and is filed under %4$s. Fol­low any responses to this post through %5$s.’, ‘mys­tique’), <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 cor­rectly imple­men­ted you should get a suc­cess mes­sage in the snip­pets test­ing tool which reads Veri­fied: Author­ship markup is cor­rect for this page

2. The second problem(रों) were with the hfeed / hentry sec­tion and included the following:

मिस आईएनजी आवश्यक hCard "लेखक".
चेतावनी दें आईएनजी: कम से कम एक क्षेत्र Hcard के लिए सेट किया जाना चाहिए.
चेतावनी दें आईएनजी: कम से कम एक क्षेत्र HatomEntry के लिए सेट किया जाना चाहिए.
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक फ़ील्ड "प्रविष्टि शीर्षक".
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक क्षेत्र "अपडेट".
चेतावनी दें आईएनजी: मिस आईएनजी आवश्यक hCard "लेखक".

समाधान(रों):

Use the word­press edit­or 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 reas­on (I’m guess­ing char­ac­ter encod­ing) it wont work. Copy it from here and paste into win­dows note­pad. Then re-copy it from win­dows note­pad (or any oth­er basic plain-text-only edit­or) and paste into the word­press edit­or. Going via note­pad loses any hid­den encod­ing or oth­er data which causes a prob­lem so the code is treated as the plain-text it is sup­posed to be

Leave a Reply