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

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

9Wordpress लोगोबीस ग्यारह विषय के लिए रिच स्निपेट्स कोड

I’ve previously detailed the code for enabling rich snippets in various wordpress themes (रहस्यपूर्ण 2, रहस्यपूर्ण 3, थीसिस & Me Gusta) as well as some generic instructions. 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, लाइन 14

<h1 class="प्रवेश शीर्षक"><?php the_title(); ?></h1>
</हैडर><!-- .entry-header -->

निम्नलिखित जोड़ें 2 पंक्तियां

<h1 class="प्रवेश शीर्षक"><?php the_title(); ?></h1>
<span class ="अद्यतन"><span class ="मूल्य-शीर्षक" title ="<?php the_date(); ?>"></विस्तार></विस्तार>
By <span class ="author vcard"><span class ="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>) and replace

<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class ="vcard"><a class="url fn n" href ="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title ="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</ए></विस्तार>' ); ?></h1>


<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class ="vcard"><a class="url fn n" href ="' . esc_url( get_the_author_meta( "google_profile" ) ) . '" title ="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</ए></विस्तार>' ); ?></h1>

हम कुछ याद है सोचो? हमें नीचे टिप्पणी से पता करते हैं. आप सदस्यता के लिए चाहते हैं, तो ऊपर दाईं ओर मेनू पर लिंक का उपयोग करें सदस्यता लें. आप नीचे दिए गए सामाजिक लिंक का उपयोग करके अपने दोस्तों के साथ इस साझा कर सकते हैं. चियर्स.

उत्तर छोड़ दें

9 टिप्पणियाँ


हाय, thanks for the code but it did not cure twenty-eleven.

There is an incongruity in the first code substitutionthe lines are identical
1. Edit functions.php, लाइन 581 edit the first line of the func­tion twentyeleven_posted_on()




I am still getting the “अद्यतन” field error and now it prints the author name at the top of pages and the update date on the top of posts.

जवाब दें
Gravatarजॉन Scaife

क्षमा करें – when I updated the post a while back I didn’t notice that the wordpress visual editor had removed all the class=”” कोड! 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. 🙂

हां – it will show the author name and the updated date on poststhis is required. Google will penalise your ranking if you try to implement snippets which tag up hidden contenttheir 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.

जवाब दें