私は以前に、様々なワードプレスのテーマにリッチスニペットを可能にするためのコードを詳述しました (神秘的雰囲気 2, 神秘的雰囲気 3, 論文 & 私は好き) だけでなく、いくつかの 一般的な指示. 以下は、内蔵のワードプレス20 11テーマのリッチスニペットを有効にするには、編集のセットです.
1. 編集のfunctions.php, ライン 584, 関数の最初の行を編集 twentyeleven_posted_on()
変更
<time class="エントリーの日付" datetime="%3$S">
に
<time class="entry-date updated" datetime="%3$S">
2. 編集コンテンツpage.php, ライン 14
<h1 class="エントリータイトル"><?php the_title(); ?></H1> </ヘッダー><!-- .entry-header -->
以下を追加します。 2 ライン
<h1 class="エントリータイトル"><?php the_title(); ?></H1> <スパンクラス="更新した"><スパンクラス="価値のタイトル" タイトル="<?php the_date(); ?>"></スパン></スパン> By <スパンクラス="著者のvCard"><スパンクラス="FN"><?php the_author_posts_link(); ?></スパン></スパン> </ヘッダー><!-- .entry-header -->
3. あなたの著者の情報ページをGoogle +のプロフィールへのリンクを持っていることを確認してください
編集のfunctions.php, 下部アドオンで
function yoast_add_google_profile( $contactmethods ) { // Add Google Profiles $contactmethods['google_profile'] = 'Google Profile <abbr title="ユニフォームリソースロケータ">URLは</略称>'; 返す$ contactmethods; } ADD_FILTER( 'user_contactmethods', 'yoast_add_google_profile', 10, 1);
その後、あなたのワードプレスのプロフィールページに行きます (ダッシュボード: ユーザー: あなたのプロフィール) そして、Googleプロフィールに記入 URLは セクション
4. Googleプロフィールにリンクする編集author.php, 編集行 28 (間で >header>
と </header>
) と交換してください
<h1 class="page-title author"><?PHPのprintf( _( 'Author Archives: %S ', 'twentyeleven' ), '<スパンクラス="vcard"><クラス="URLのFNのN" HREF ="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" タイトル="' . esc_attr( get_the_author() ) . '" REL ="私に">' . get_the_author() . '</a></スパン>' ); ?></H1>
とともに
<h1 class="page-title author"><?PHPのprintf( _( 'Author Archives: %S ', 'twentyeleven' ), '<スパンクラス="vcard"><クラス="URLのFNのN" HREF ="' . esc_url( get_the_author_meta( "google_profile" ) ) . '" タイトル="' . esc_attr( get_the_author() ) . '" REL ="私に">' . get_the_author() . '</a></スパン>' ); ?></H1>
これが有用であることが判明? 以下のコメントをドロップすることによって、私たちに知らせてください. あなたが購読したい場合は、右上のメニューで購読リンクをご利用ください. また、下記の社会的なリンクを使用してお友達とこれを共有することができます. 乾杯.
どうもありがとう.
Is this solution for twentytwelve ?
イムは、静的なウェブサイト上での作業と私は本当に私のウェブページに管理者によって更新見せたいんでし. 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…. ????
感謝
私はあなたに記念碑を賭けるだろう, ありがとう
こんにちは,
あなたは解決策がtwentytwelveにもあると思いますか?
事前に感謝し、あなたから話を聞くことを望む
驚くばかり, problem solved… Thanks for brilliant tutorial.
喜び, あなたのコメントをありがとう🙂
こんにちは, コードのおかげで、それは二十から十一を硬化しなかった.
There is an incongruity in the first code substitution – the lines are identical
1. 編集のfunctions.php, ライン 581 機能twentyeleven_posted_onの最初の行を編集()
変更
1
に
1
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.
ごめんなさい – 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…
アップデート: 私は完全にコードが実装され、表示方法rejiggedました. うまくいけば、これは将来の再発を防止します, そして道に沿って私は機能性とプレゼンテーションがあまりにも改善されていると思います. 私はあなたが何をしましょう. 🙂
はい – 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 (当然 私見) あなたが考える場合は、検索エンジンはその情報を参照しなければならないということです, それは有用な情報です, したがって、あなたの訪問者は、あまりにもそれを見るべき! あなたは簡単に適用することができます CSS それをスタイル、あなたが望むなら、それを再配置します.