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

Any Wordpress PlugIn That Rotate Ads Based On Category

Discussion in 'Blogging' started by fizzlemahoe, Jul 30, 2010.

  1. fizzlemahoe

    fizzlemahoe Regular Member

    Joined:
    Feb 2, 2007
    Messages:
    263
    Likes Received:
    216
    I'm looking for a wordpress plugin that will rotate ads/show the ad I want based on the category for example:

    I have these categories:

    Weight Loss
    Insurance
    Pregnancy/Childbirth
    Education
    Etc.

    Say I'm promoting stuff like free diapers, fat loss 4 idiots, health insurance, education offer like nursing school or something.

    I want to show the
    Free Diapers Ad when they click on the category/browse posts on Pregnancy/Childbirth only.
    Fat Loss 4 Idiots Ad when they click on the category/browse posts on weight loss only.
    Health Insurance Ad when they click on the category/browse posts on insurance only.
    Nursing School Ad when they click on the category/browse posts on education only.
    Etc.

    Is there any plugin like that? Hope someone can help me with it. Thanks
     
  2. fizzlemahoe

    fizzlemahoe Regular Member

    Joined:
    Feb 2, 2007
    Messages:
    263
    Likes Received:
    216
    Anyone can help me?
     
  3. 15challenger

    15challenger Registered Member

    Joined:
    Nov 18, 2009
    Messages:
    67
    Likes Received:
    16
    Thesis's multimedia box allows you to select which video/image/offer you want to display on which post. Although I am looking for such plugin too.
     
    • Thanks Thanks x 1
  4. fizzlemahoe

    fizzlemahoe Regular Member

    Joined:
    Feb 2, 2007
    Messages:
    263
    Likes Received:
    216
    Is that a theme? I'm really looking for a plugin that does this. does anyone know. I thought I remember seeing a plugin that does it but forgot whats it call
     
  5. 15challenger

    15challenger Registered Member

    Joined:
    Nov 18, 2009
    Messages:
    67
    Likes Received:
    16
    ^^
    Yes, thesis is a theme. I am installing wordpress blogs at large these days. I keep looking for plugins. Will inform if i come across any such plugin.
     
  6. reinie

    reinie Elite Member

    Joined:
    Jan 16, 2009
    Messages:
    1,574
    Likes Received:
    1,040
    Well im not sure if i understand you right, but i had similar issue untill i installed advanced adsense plugin.

    It has the options to display ads based on tags, and im sure you have tags in your category.

    They say it takes about 2 weeks for it to function properly...i have installed it for 3 days and i can already see little better results
     
    • Thanks Thanks x 1
  7. xXSebaSXx

    xXSebaSXx Registered Member

    Joined:
    May 8, 2009
    Messages:
    52
    Likes Received:
    28
    I haven't been able to find a plugin that does what you request exactly, but no fear. Accomplishing what you want is really simple with an ad rotating plugin and a little bit of php.
    I personally use adrotate in my sites, so my php examples will be done with that one.
    Here goes.
    When you install AdRotate you have the option of adding widgets to your sidebar from your admin control panel, or you can insert a php function to your theme files if you want to call the plugin from anywhere on your sites other than the sidebar. We will go this way.
    This is the function that you enter in your theme file where you want the adrotate plugin to display your ad.
    Code:
    <?php echo adrotate_banner('1'); ?>
    This code is basically telling the plugin to display the advert that you have saved in your admin control panel in Ad Group 1.

    So let's now tackle what you want to achieve. You say that you want ads that are specific to a category to be displayed when the visitor clicks on the category or browses posts from that category. This task has to be divided in two parts. One for when the visitor clicks on the category link and the second one for when the visitor is viewing a post in that category.

    1. When the visitor clicks on the category link --> This is driven by the archive.php file in your WP theme folder. So we will need to edit that file a little bit.
    Here is what the PHP code would look like for the particular case you mentioned.
    Code:
    <?php
    	if ( in_category('weight-loss')) {
    		echo adrotate_banner('1'); ## Where 1 would be the ad group containing ads for Weight Loss
    	}
    	elseif ( in_category('insurance')); {
    		echo adrotate_banner('2'); ## Where 2 would be the ad group containing ads for Insurance
    	}
    	elseif ( in_category('pregnancy-childbirth')) {
    		echo adrotate_banner('3'); ## Where 3 would be the ad group containing ads for Pregnancy & Child Birth
    	}
    	else ( in_category('education')) {
    		echo adrotate_banner('4') ## Where 4 would be the ad group containing ads for Education
    	}		
    ?>
    
    2. When the visitor is viewing a particular post in a given category --> This is driven by the single.php file in your WP theme folder. You would need to just add the PHP above to the single.php wherever you want the ads to be displayed and that is it.

    Disclaimer
    I am not related to AdRotate in any way. I merely used it because it is the plugin I use to manage ads on my sites and it's the one I'm familiar with. You can use any plugin you want... The only thing would be to change the code to call the function that relates to whatever plugin you decide to go with.

    That's it!!! I know it's not a plugin that will do it for you, but it gets the job done.
    Cheers
    Sebastian
     
    Last edited: Aug 3, 2010
  8. bobbylove321

    bobbylove321 BANNED BANNED

    Joined:
    Nov 8, 2008
    Messages:
    1,987
    Likes Received:
    2,198
    fizzlemahoe,

    I use "Max Banner Ads" and it rotates, but I don't know if you can do it by category since I haven't tried that, but it might help you if you take a look at it.