I’ve previously detailed the code for enabling rich snippets in various wordpress themes ([intlink id=“2948” type=“post”]mystique کے 2[/intlink], [intlink id=“2949” type=“post”]mystique کے 3[/intlink], [intlink id=“2468” type=“post”]مقالہ[/intlink] & [intlink id=“3017” type=“post”]Me Gusta[/intlink]) as well as some [intlink id=“1520” type=“post”]generic instructions[/intlink]. Below is a set of edits to enable rich snippets in the built-in wordpress twenty eleven theme.
1. Edit functions.php, لائن 584, edit the first line of the function twentyeleven_posted_on()
and change
<time class="entry-date" datetime="%3$ے">
کرنے کے لئے
<time class="entry-date updated" datetime="%3$ے">
2. Edit content-page.php, line 14
<h1 class="داخلے کی عنوان"><?php the_title(); ?></H1> </ہیڈر><!-- .entry-header -->
add the following 2 lines
<h1 class="داخلے کی عنوان"><?php the_title(); ?></H1> <مدت کلاس ="اپ ڈیٹ"><مدت کلاس ="قیمت عنوان" عنوان ="<?php the_date(); ?>"></دورانیہ></دورانیہ> By <مدت کلاس ="author vcard"><مدت کلاس ="FN"><?php the_author_posts_link(); ?></دورانیہ></دورانیہ> </ہیڈر><!-- .entry-header -->
3. Make sure your author information page has a link to your google+ profile
Edit functions.php, at the bottom add
function yoast_add_google_profile( $contactmethods ) { // Add Google Profiles $contactmethods['google_profile'] = 'Google Profile <abbr title="یونیفارم ریسورس لوکیٹر">یو آر ایل</abbr>'; return $contactmethods; } add_filter( 'user_contactmethods', 'yoast_add_google_profile', 10, 1);
then go to your wordpress profile page (dashboard: صارفین: your profile) and fill in the google profile یو آر ایل سیکشن
4. Edit author.php to link to google profile, edit line 28 (between >header>
اور </header>
) اور تبدیل کریں
<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<مدت کلاس ="vcard"><a class="url fn n" href کی ="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" عنوان ="' . esc_attr( get_the_author() ) . '" rel="مجھے">' . get_the_author() . '</ایک></دورانیہ>' ); ?></H1>
ساتھ
<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<مدت کلاس ="vcard"><a class="url fn n" href کی ="' . esc_url( get_the_author_meta( "google_profile" ) ) . '" عنوان ="' . esc_attr( get_the_author() ) . '" rel="مجھے">' . get_the_author() . '</ایک></دورانیہ>' ); ?></H1>
بہت بہت شکریہ.
Is this solution for twentytwelve?
Im working on a static website and i really didnt want to show updated by admin on my webpages. is there any way i can hide that but remove snippets error too…
i know u said its not recommended method but do u know how can i do that.…????
شکریہ
میں آپ کو ایک یادگار شرط لگاتا ہوں گا, آپ کا شکریہ
ہیلو,
Do you think that the solution is also for twentytwelve?
thanks in advance and hope to hear from you
Awesome, problem solved… Thanks for brilliant tutorial.
ایک درخواست-ure, thanks for your comment 🙂
ہیلو, thanks for the code but it did not cure twenty-eleven.
There is an incongruity in the first code substitution — the lines are identical
1. Edit functions.php, لائن 581 edit the first line of the function twentyeleven_posted_on()
change
1
کرنے کے لئے
1
I am still getting the “update” field error and now it prints the author name at the top of pages and the update date on the top of posts.
Sorry — when I updated the post a while back I didn’t notice that the wordpress visual editor had removed all the class=”” code! It should now be fixed…
اپ ڈیٹ: I’ve totally rejigged how code is implemented and displayed. Hopefully this will prevent any future recurrence, and along the way I think the functionality and presentation has been improved too. Let me know what you think. 🙂
Yes — it will show the author name and the updated date on posts — this is required. Google will penalise your ranking if you try to implement snippets which tag up hidden content — their view (rightly IMHO) is that if you think a search engine should see that information, then it’s useful information, and therefore your visitors should see it too! You can easily apply سی ایس ایس to style it and reposition it if you wish.