Sizlopedia

Categories ▼カテゴリー▼

How to Display Category Specific Content in Wordpress Wordpressの特定の方法で表示されるカテゴリのコンテンツに

One thing I love about Wordpress is the great flexibility it offers in terms of designing custom themes and for this all the credit goes to Wordpress私はWordpressの愛についての一つは、カスタムテーマをデザインし、このすべての信用のための面で大きな柔軟性を提供しているワードプレスに行く Template Tagsテンプレートタグ .

Recently I ran into a problem where I wanted to monetize the posts in my Gadgets category with TTZmedia ads while keeping the normal Google Adsense ads on all other posts.最近、私は問題にどこTTZmedia広告を掲載する他のすべての投稿には、通常のGoogle AdSenseの広告を維持で自分のガジェットのカテゴリーで記事を収益化していた。 This is when I found theこれは、私は見ている in_category template function which lets you display category specific content in Wordpress.ワードプレスでは、特定のコンテンツのカテゴリを表示できる機能のテンプレートです。

The function is simple and very easy to use.この関数は、非常に使いやすいシンプルです。 Just use it in the Loop on any template file and it should work file.だけで任意のファイルをテンプレート上のループで使用してファイルを動作するはずです。

<?php if ( in_category('category_id') ): ?>
// Some category specific PHP/HTML here
<?php endif; ?>

More detailed info and examples can be found on the link below:より詳細な情報と例を以下のリンクを見つけることができます:

http://codex.wordpress.org/Template_Tags/in_category

This can be helpful to monetize posts from certain categories with specific ads and can also be used to display information about a particular category.この特定の広告を特定のカテゴリの記事を収益化し、参考になることも、特定のカテゴリについての情報を表示するために使用することができます。

A live implementation of this template function can be seen here on Sizlopedia.この関数の実装テンプレートのライブSizlopediaここで見ることができます。 If you visit any post that belongs to theに属する場合は、すべての投稿を訪問 Gadgetsガジェット category you will see targeted product ads while in other cases you will see the normal Google Adsense ads.製品カテゴリーをターゲットとした広告が表示されますが、他のケースでは、通常のGoogle AdSenseの広告が表示されます。

Related Articles関連記事

Commentsコメント

Thats a good trick.特に良いのトリック。 You can also use templates for categories, then you can style or display information specific to that categoryまた、カテゴリーのテンプレートを使うことができますし、あなたのスタイルやディスプレイの情報は、特定のカテゴリにすることができます

Thanks a lot its really gonna help me in my search for latest stumbles for my site.どうもありがとう、本当に私のサイトの最新stumblesは私のメインの検索に役立つと思ってたの。

Interesting guide.面白いガイドです。 Thanks for the detailed guide on how to embed Google Adsense Ads to categories.上の詳細なガイドをお寄せいただきありがとうございますGoogleのAdSense広告を埋め込む方法についてのカテゴリにしてください。 Is there other parts in Wordpress where you can embed Ads? Wordpressのある場所に広告を埋め込むことができる他の部分はありますか?

@Rommel @ロンメル

The best position to embed Google ads is above the content and below the title of article. Googleの広告を埋め込むための最も良い位置は、コンテンツ上で、記事のタイトルの下に。 There you get the highest click through rates.そこをクリックスルー率は最高になる。

Leave a Commentコメントを残しなさい

Name: (Required) 名前: (必須

E-mail: (Required) E - mailアドレス: (必須

Website: (Optional) ウェブサイト: (オプション

Comment: コメント: