I’ve previously written about rich snippets code for[intlink id=“2948” type=“post”]أحجية 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”]أحب[/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 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
ثالث, 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:
ملكة جمال جي المطلوبة hCard "الكاتب".
جي تحذير: يجب تعيين حقل واحد على الأقل لHcard.
جي تحذير: يجب تعيين حقل واحد على الأقل لHatomEntry.
جي تحذير: ملكة جمال جي حقل مطلوب "دخول عنوان".
جي تحذير: ملكة جمال جي حقل مطلوب "تحديث".
جي تحذير: ملكة جمال جي المطلوبة 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 🙂