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 имеет большую гибкость он предлагает в плане разработки пользовательских темы и за все это заслуга в 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. Шаблон функции, которая позволяет отображать категории конкретным содержанием в 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. Добрые THATS трюк. 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. Большое спасибо его действительно собираешься мне помочь в моем поиске последних оступится на моем сайте.

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 @ 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) Электронная почта: (обязательно)

Website: (Optional) Сайт: (необязательно)

Comment: Комментарий: