2ورڈپریس علامتmystique کے 3.x کے لئے امیر کے ٹکڑوں کا کوڈ

I’ve pre­vi­ously writ­ten about rich snip­pets code for[int­link id=“2948” type=“post”]mystique کے 2[/intlink].  There are also[int­link id=“1520” type=“post”]generic instructions[/intlink] and code for the themes [int­link id=“3015” type=“post”]twenty eleven[/intlink], [int­link id=“3017” type=“post”]me gusta[/intlink] اور [int­link id=“2468” type=“post”]مقالہ[/intlink].  Below is updated code for Mys­tique 3

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

حل:

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 کی (as shown below) to functions.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);[/پی ایچ پی]

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

[پی ایچ پی]
<?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 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:

مس ING ضرورت hCard "مصنف".
انتباہ والے: کم از کم ایک میدان Hcard کے لئے مقرر کیا جانا چاہیے.
انتباہ والے: کم از کم ایک میدان HatomEntry کے لئے مقرر کیا جانا چاہیے.
انتباہ والے: مس کر مطلوبہ فیلڈ "داخلے کی عنوان".
انتباہ والے: مس ING مطلوبہ فیلڈ "اپ ڈیٹ".
انتباہ والے: مس ING ضرورت hCard "مصنف".

حل(ے):

Use the word­press edit­or 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 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!

جواب چھوڑیں

2 تبصرے

Rروب

Is there an update for this since the code is so much dif­fer­ent now using the atom engine?
I have tried to pos­sibly add the code with the atom calls but I am just a little unsure of how to get this to work properly.

جواب دیں
جے ایسجان Scaife

Not yet as this code still works. کس طرح کبھی, I will be doing an update of it all in the near future — once the issues asso­ci­ated with the migra­tion of the site have been resolved 🙂 Check back in 3–4 weeks 🙂

جواب دیں