I’ve previously written about rich snippets code for[intlink id=“2948” type=“post”]mystique کے 2[/intlink]. There are also[intlink id=“1520” type=“post”]generic instructions[/intlink] and code for the themes [intlink id=“3015” type=“post”]twenty eleven[/intlink], [intlink id=“3017” type=“post”]me gusta[/intlink] اور [intlink id=“2468” type=“post”]مقالہ[/intlink]. Below is updated code for Mystique 3
1. The first problem was with the author information / hrecipe section
حل:
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 کی (as shown below) to functions.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);[/پی ایچ پی]
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
[پی ایچ پی]
<?php if(($app—>author->get(‘user_url’)) && ($app->author->get(‘user_url’)!== ‘https://’)): ?>
<?php _ae(‘Home page:’); ?>
<?php endif; ?>
[/پی ایچ پی]
And add the following
[پی ایچ پی]
<?php if(($app—>author->get(‘google_profile’)) && ($app->author->get(‘google_profile’)!== ‘https://’)): ?>
<?php _ae(‘Google Profile:’); ?>
<?php endif; ?>
[/پی ایچ پی]
Then I edited AtomObjectAuthor.php and changed line 213 by adding rel=“author” so it reads as follows
[پی ایچ پی]
return ‘<a title=“ ‘.$title.’ ” href=“ ‘.$this->getPostsURL().’ ” rel=“author”>’.$this->getName().’</ایک>’;
[/پی ایچ پی]
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:
مس ING ضرورت hCard "مصنف".
انتباہ والے: کم از کم ایک میدان Hcard کے لئے مقرر کیا جانا چاہیے.
انتباہ والے: کم از کم ایک میدان HatomEntry کے لئے مقرر کیا جانا چاہیے.
انتباہ والے: مس کر مطلوبہ فیلڈ "داخلے کی عنوان".
انتباہ والے: مس ING مطلوبہ فیلڈ "اپ ڈیٹ".
انتباہ والے: مس ING ضرورت hCard "مصنف".
حل(ے):
Use the wordpress editor to edit single.php
Find the code
[xhtml]
<h1 class=“title”></H1>
[/xhtml]
replace this with…
[xhtml]
<h1 class=“title entry-title”></H1>
<h2 class=“updated”></h2>
<h2 class=“vcard”></h2>
[/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!
Is there an update for this since the code is so much different now using the atom engine?
I have tried to possibly add the code with the atom calls but I am just a little unsure of how to get this to work properly.
Not yet as this code still works. کس طرح کبھی, I will be doing an update of it all in the near future — once the issues associated with the migration of the site have been resolved 🙂 Check back in 3–4 weeks 🙂