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

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

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

I’ve pre­vi­ously detailed the code for enabling rich snip­pets in vari­ous word­press themes ([int­link id=“2948” type=“post”]रहस्यपूर्ण 2[/intlink], [int­link id=“2949” type=“post”]रहस्यपूर्ण 3[/intlink], [int­link id=“2468” type=“post”]थीसिस[/intlink] & [int­link id=“3017” type=“post”]Me Gusta[/intlink]) as well as some [int­link id=“1520” type=“post”]generic instructions[/intlink]. Below is a set of edits to enable rich snip­pets in the built-in word­press twenty elev­en theme.

1. Edit functions.php, लाइन 584, edit the first line of the func­tion 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 fol­low­ing 2 lines

<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 inform­a­tion page has a link to your google+ profile
Edit functions.php, at the bot­tom 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 word­press pro­file page (dash­board: उपयोगकर्ता: your pro­file) and fill in the google pro­file यूआरएल अनुभाग

4. Edit author.php to link to google pro­file, 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 Comments

एससैम

Im work­ing on a stat­ic web­site and i really did­nt want to show updated by admin on my webpages. is there any way i can hide that but remove snip­pets error too…
i know u said its not recom­men­ded meth­od but do u know how can i do that.…????
धन्यवाद

जवाब दें
एसsdpate956

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

There is an incon­gru­ity in the first code sub­sti­tu­tion — the lines are identical
1. Edit functions.php, लाइन 581 edit the first line of the func­tion twentyeleven_posted_on()
change

1

तक

1

I am still get­ting 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.

जवाब दें
JSजॉन स्काइफ़

Sorry — when I updated the post a while back I did­n’t notice that the word­press visu­al edit­or had removed all the class=”” code! It should now be fixed…

अद्यतन: I’ve totally rejigged how code is imple­men­ted and dis­played. Hope­fully this will pre­vent any future recur­rence, and along the way I think the func­tion­al­ity and present­a­tion 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 pen­al­ise your rank­ing if you try to imple­ment snip­pets which tag up hid­den con­tent — their view (rightly IMHO) is that if you think a search engine should see that inform­a­tion, then it’s use­ful inform­a­tion, and there­fore your vis­it­ors should see it too! You can eas­ily apply सीएसएस to style it and repos­i­tion it if you wish.

जवाब दें