1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WP - How to display adsense overy other post in ONE specific category?

Discussion in 'Blogging' started by MetalMan390, Nov 30, 2011.

  1. MetalMan390

    MetalMan390 Regular Member

    Joined:
    Sep 26, 2009
    Messages:
    285
    Likes Received:
    18
    Using wordpress, (wp-clear theme), how do I display adsense after every other post, but only in one specific category? I don't know php at all and could use a "dumbed down" answer.
     
  2. Seo Lover

    Seo Lover Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Jan 30, 2011
    Messages:
    5,717
    Likes Received:
    4,147
    Gender:
    Male
    Occupation:
    Hanging Around Interwebs !
    Location:
    <-----------------Sin City
    Easy Adsense or Adsense Deluxe will do this (Both WP plugins)
     
  3. a_z_0_9

    a_z_0_9 Junior Member

    Joined:
    Jul 18, 2011
    Messages:
    110
    Likes Received:
    21
    You can try adding this script to your wordpress index page, replace category_name with category you want to use this code for

    PHP:
    <?php $count 1?>
    <?php 
    if (have_posts()) : ?>
    <?php 
    while (have_posts()) : the_post(); ?>
    .................................

    <?php if (($count 1) && (the_category(', ') == 'CATEGORY_NAME')) : ?>
    ADSENSE_CODE HERE
    <?php endif; $count++; ?>