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 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 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.

  • 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. Большое спасибо ему действительно Gonna помочь мне в моих поисках последних натыкается на мой сайт.
  • 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. Там вы получите самый высокий нажмите через тарифы.
  • Thank you for this information. Спасибо вам за эту информацию. :) :)
blog comments powered by Disqus Блог комментарии сила Disqus