Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressで投稿コンテンツの後に署名や広告を追加する方法

WordPressでブログ投稿コンテンツの後に署名や広告を追加したいですか?

WordPressの初期設定では、各投稿コンテンツの後に広告や個人的な署名を表示する簡単な方法は用意されていません。

この投稿では、WordPressで投稿コンテンツの後に署名や広告を追加する方法を紹介します。

How to Add Signature or Ads after Post Content in WordPress

なぜWordPressで投稿コンテンツの後に署名や広告を追加するのですか?

WordPressで初めてサイトを作成した場合、各投稿の最後にコンテンツを自動的に追加する方法はありません。そのため、ブログ投稿の後に署名を追加したり、広告を表示したりすることが難しい。幸いなことに、WordPressにこの機能を追加できる方法がいくつかある。

署名を追加する場合、実際の署名の画像、手書きフォントでフォーマットされた名前、または単に名前を添えたフレンドリーな締めの挨拶を使用することができます。

複数の投稿者がいる場合、それぞれの投稿日に同じ署名を表示させたくないでしょう。その代わりに、WordPressの投稿日に著者情報ボックスを追加する方法のガイドに従ってください。

また、このチュートリアルでは、サイト上のすべての投稿の後に広告を表示することができます。一部の投稿にのみ広告を表示するには、WordPressで特定の投稿に広告ブロックを表示する方法のガイドを参照してください。

ということで、WordPressで投稿コンテンツの後に署名や広告を追加する方法を見てみましょう。ここでは3つの方法を取り上げますが、ほとんどのユーザーには最初の方法をお勧めします:

方法1:WPCodeで投稿コンテンツの後に署名や広告を追加する(自動的)

投稿コンテンツの後に署名や広告を追加する最も簡単な方法は、無料のWPCodeプラグインを使用することです。

WPCodeは、WordPressのための最高のコードスニペットプラグインです。WordPressの任意のページ、投稿日、ウィジェットエリアに広告を表示するコードを簡単に挿入することができます。また、投稿コンテンツの後に署名を表示するためのカスタマイザーコード、画像、テキストを追加することもできます。

開始するには、無料のWPCodeプラグインをインストールし、有効化する必要があります。ヘルプが必要な場合は、WordPressプラグインのインストール方法のチュートリアルに従ってください。

注:スケジュールスニペット、コンバージョンピクセル、eコマーストラッキングなどの高度な機能を備えたWPCodeのプレミアムバージョンもあります。

プラグインを有効化したら、WordPressダッシュボードからCode Snippets ” + Add Snippetに移動します。

ビルトインのコード・スニペット・ライブラリが表示されます。ここから、「カスタムコードを追加(新規スニペット)」オプションにマウスオーバーし、「スニペットを使用」ボタンをクリックして選択します。

Choose the Custom Code option in the WPCode library to insert an ad

カスタム・スニペットの作成」ページで、スニペットのタイトルを追加する必要があります。これはあくまで参考用です。

次に、表示したいコードをコピー&ペーストして「コードプレビュー」ボックスに入力するだけです。

広告を表示している場合は、Google Adsenseなどの広告サービスから受け取ったコードを貼り付けます。

署名を追加する場合は、「読んでくれてありがとう、ジョニー」のようなテキスト署名を入力するだけです。また、<img src="link-to-image">のように、実際の署名の画像を含めるコードを入力することもできます。

また、画面右側のドロップダウンリストから「コードタイプ」として「HTMLスニペット」を選択する必要があります。

Paste code for signature or ad in the Code Preview box

コードを貼り付けたら、「インサーター」セクションまでスクロールダウンする必要があります。主に2つの挿入オプションがあります:

  • 自動インサーター– あなたの署名または広告コードは自動的に挿入され、選択した場所にあなたのサイトで実行されます。
  • ショートコード– あなたの署名や広告コードは自動的にインサーターされません。代わりに、あなたのサイトの任意の場所に手動で挿入することができるショートコードを取得します。

このチュートリアルでは、「自動挿入」メソッドをクリックし、「場所」フィールドの隣にあるドロップダウンリストから「コンテンツの後に挿入」オプションを選択します。

Select Auto-Insert After Content to add signature or ad after post content

WPCodeでは、投稿コンテンツの後以外にも、投稿コンテンツの冒頭、段落の後、投稿と投稿の間など、様々な場所に署名や広告をインサーターすることができます。

Additional auto-insert locations in WPCode

署名や広告を公開するには、ページのトップに戻り、スイッチを「非有効化」から「有効化」に切り替えるだけです。

最後に、「スニペットを保存」ボタンをクリックする。

Activate and save ad code in WPCode plugin

これで完了です!投稿コンテンツの後に、あなたの署名や広告が自動的に挿入されます。

サイト上の投稿にアクセスすると、投稿コンテンツの後に署名や広告が表示されます。デモサイトではこのように表示されました:

Example of Signature Added After Blog Post Content

方法2:アドインサーターを使って投稿コンテンツの後に署名や広告を追加する。

この方法では、まずAd Inserter – Ad Manager & AdSense Adsプラグインをインストールして有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

このプラグインは、Google Adsenseをサポートしています,Amazon広告, その他の広告プラットフォーム.しかし、それは広告を表示することに限定されるものではない。投稿に任意のコード、画像、テキストを追加するために使用することができます。

有効化した後、プラグイン設定を構成するために設定 ” アドインサーターページにアクセスする必要があります。ページ上部には、サイトに複数の広告や署名を追加できるタブがあります。このチュートリアルでは、タブ1に留まります。

タブの下にはテキストエディターがあり、広告コードや署名など、表示したいコンテンツを入力することができます。

Enter Your Ad Code or Signature in the Plugin's Text Editor

次に、テキストエディターの下にスクロールダウンし、広告または署名を表示する場所を選択する必要があります。初期設定では’投稿’ボックスがチェックされており、静的ページ、ホームページ、検索ページ、カテゴリーページ、タグアーカイブページのオプションもあります。

Select Where to Display the Ad or Signature

次に、ドロップダウンメニューからインサーターポイントを選択します。すべての投稿の後に広告や署名を表示するには、「コンテンツの後」を選択します。

どの段落の後に広告を表示するかも選択できます。例えば、「段落の後」を選択し、次のフィールドに「2」と入力すると、広告は折り返しの少し後に表示されます。

設定が完了したら、「Save Settings 1 – 16」ボタンをクリックしてください。これで最初の16タブの広告の設定が保存されます。

これで、あなたのサイトにアクセスして投稿を表示し、広告や署名を見ることができます。デモサイトではこのように表示されます。

Preview of Signature Added After Blog Post Content

方法3:コードを使用して投稿コンテンツの後に署名または広告を追加する(上級者向け)

この方法では、WordPressファイルにコードを追加する必要があります。WordPressでコード・スニペットを貼り付ける方法については、初心者向けガイドをご覧ください。

まず、このコードをテーマのfunctions.phpファイル、サイト固有のプラグイン、またはコード・スニペット・プラグインに追加する必要があります。

繰り返しになりますが、WordPressでこのコードを追加するには、無料のWPCodeプラグインを使用することをお勧めします。そうすれば、テーマのfunctions.phpファイルを編集する必要も、サイトを壊す心配もない。

// Add signature or ad after post content
 
function wpb_after_post_content($content){
if (is_single()) {  
    $content .= 'Your signature or ad code goes here';
}
    return $content;
}
add_filter( "the_content", "wpb_after_post_content" );

5行目の「Your signature or ad code goes here」を、表示したい広告コード、画像、または署名に置き換えることを忘れないでください。本当に〜してもよいですか?

あなたのサイトにアクセスして、あなたの署名や広告を実際に見ることができます。

WordPressで投稿コンテンツの後に署名や広告を追加する方法について、このチュートリアルがお役に立てれば幸いです。また、無料のビジネスメールアドレスの作成方法や、サイトを成長させるために必須のプラグインリストもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

23件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Kelly says

    I added this code to my site specific plugin and it isn’t showing up in my posts. Do I add the text content I want to appear in place of every $comment?

    • WPBeginner Support says

      You would want to ensure you are closing the content in single quotes and after the = in line 5 of the code method.

      管理者

  3. Melissa Hoyle says

    I am trying to use this to add a signature to my posts. I uploaded my image to my media library then grabbed the image source code and pasted that into the box “Advert Code”. However, just the code displays on my posts and no image. How do I correctly generate a code so that my image displays? Thanks!

  4. joseph Tersoo says

    Thanks for the post It worked for me, how ever how can i add a title to it? i am using the second method on my site to display ads, i want to add a title to it like, “others are reading this” how can i achieve this?

    • WPBeginner Support says

      You would need to add the html for what you are using on your theme for titles in terms of h tags to add a title using that manual method.

      管理者

  5. Clive says

    Hi,
    Thanks that is really interesting but it does just add the text to the screen output, can that signature be automatically added to the contents that is written to the table.

  6. Molly says

    I’m using code snippet and inserting the signature code into the snippet editor but when I add the image url into the content – it just shows as a link written out into text. How do I add image link into content block so it shows as an image?

  7. Catherine Kelleher says

    Hello, trying to get this to work on images i have uploaded to us as ads?? can anyone help please

  8. abu bakar says

    i have this website link is
    i want to stop the ajax loading but i dont know how to do that can any one help me with that
    i really appreciate it..
    Thnakx

  9. Barry says

    Question: Insert Post Ads, according to the WordPress plugin page says it hasn’t been updated in two years and is only compatible up to WordPress 4.3.8.– so will you be updating it so can be used?

  10. Rezza Indra says

    Hy WPBeginner thanks for sharing, I like this website that’s a help me for building blog with WordPress CMS. I want to ask for tutorial make menu accordion as above (BEGINNER’S GUIDE FOR WORDPRESS / Start your WordPress Blog in minutes)

    please tell how to make, thanks guys

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。