私は以前に、様々なワードプレスのテーマでリッチスニペットを有効にするためのコードを詳しく説明しました (MYS-tique 2, MYS-tique 3, 論文 & 私は好き) だけでなく、いくつかの 一般的な指示. 以下は、内蔵のワードプレス20 11テーマのリッチスニペットを有効にするには、編集のセットです.
1. 編集のfunctions.php, ライン 584, 機能のTiONの最初の行を編集 twentyeleven_posted_on()
変更
584 | <time class=“entry-date” datetime=”%3$s”> |
に
584 | <time class=“entry-date updated” datetime=”%3$s”> |
2. 編集コンテンツpage.php, line 14
13 14 | <h1 class=“entry-title”><?php the_title(); ?></h1> </header><!– .entry-header –> |
add the following 2 lines
13 14 15 16 | <h1 class=“entry-title”><?php the_title(); ?></h1> <span class=“updated”><span class=“value-title” title=”<?php the_date(); ?>”></span></span> By <span class=“author vcard”><span class=“fn”><?php the_author_posts_link(); ?></span></span> </header><!– .entry-header –> |
3. Make sure your author information page has a link to your google+ profile
編集のfunctions.php, ボトムのアドオンで
1 2 3 4 5 6 | function yoast_add_google_profile( $contactmethods ) { // Add Google Profiles $contactmethods[‘google_profile’] = ‘Google Profile <abbr title=“Uniform Resource Locator”>URL</abbr>’; return $contactmethods; } add_filter( ‘user_contactmethods’, ‘yoast_add_google_profile’, 10, 1); |
その後、あなたの言葉プレスプロファイルページに移動 (ダッシュボード: ユーザー: あなたのプロファイル) とGoogleプロファイルに記入 URLは セクション
4. プロファイルをGoogleにリンクする編集author.php, 編集行 28 (間で >header>
と </header>
) と交換してください
28 | <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() . ‘</a></span>’ ); ?></h1> |
とともに
28 | <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() . ‘</a></span>’ ); ?></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. 私はそれを隠し、あまりにもスニペットのエラーを削除することができますどのような方法があります...
i know u said its not recommended method but do u know how can i do that.…????
感謝
私はあなたに記念碑を賭けるだろう, ありがとう
ハイ,
あなたは解決策がtwentytwelveにもあると思いますか?
事前に感謝し、あなたから話を聞くことを望む
畏敬の念をいくつか, 華麗なチュートリアルのための問題解決···おかげで.
嘆願-URE, あなたのコメントをありがとう🙂
ハイ, コードのおかげで、それは二十から十一を硬化しなかった.
最初のコード置換を違和感がある - ラインは同じです
1. 編集のfunctions.php, ライン 581 機能twentyeleven_posted_onの最初の行を編集()
変更
1
に
1
私はまだ「更新」フィールドのエラーを取得していますし、今では柱の上にページの上部に、著者名と更新日を出力します.
Sorry — when I updated the post a while back I didn’t notice that the wordpress visual editor had removed all the class=”” code! これは、今すぐ修正する必要があります...
アップデート: 私は完全にコードの実装方法rejiggedと表示しました. うまくいけば、これは将来の再発を防ぐことができます, と私の考え方に沿って機能性とプレゼンテーションはあまりにも改善されました. Let me know what you think. 🙂
はい - それは、著者名とポストに更新された日付が表示されます - これが必要です. 彼らの見解 - あなたがスニペットにどのタグを上に隠されたコンテンツを実装しようとすると、Googleはあなたのランキングを罰するでしょう (当然 私見) あなたが考える場合には、検索エンジンはその情報が表示されるはずということです, それは、使いFULのお知らせ-のTiONを, したがって、あなたの訪問者は、あまりにもそれが表示されます! あなたはEAS-ILY適用することができます CSS ご希望があれば、それをスタイルとレポ - I-TiONをそれに.