How to post DIFFERENT ads for Different categories in WordPress ?????

2 replies
OK... I've been SCOURING the net to find this out... and SURELY, some mighty warrior will know the answer to this....

Suppose I have a transportation WP blog. And I have 3 categories.

1- air transportation
2- land transportation
3- transportation by sea

I want to make the most out of my advertising and instead of just advertising Travelocity to all 3 pages, I want to give my target market what they want.

I want to display ads for airlines on the first, discount car rentals on the 2nd and cheap cruises on the 3rd....

HOW DO I DO IT?!!! More importantly, how do I do it EASILY! lol

There must be a plugin that does this!

Thanks for your help oh brave and noble warriors.

~Russell Prisco =)
#ads #categories #different ads #different categories #post #wordpress
  • Profile picture of the author JohnMcCabe
    Russell, it depends on where you want the ads to appear.

    If you want them in the sidebar, you first create custom sidebars for each category, i.e.

    sidebar-air.php
    sidebar-land.php
    sidebar-sea.php

    The content in each is the same as your regular sidebar, except for the ad code.

    Next, in your category and single post templates, you add a conditional statement so that the correct sidebar is displayed.

    If category = 'land' then [include sidebar-land.php]
    elseif category = 'air' then [include sidebar-air.php]
    elseif category = 'sea' then [include sidebar-sea.php]
    else include standard sidebar.

    I don't know of a plug-in, but a good php coder could knock it together for you pretty quick and cheap, I'm guessing.

    If you want the ad in the post itself, you'd use the same general process. It would be simpler because you could insert the conditional right in the single.php template.

    Maybe someone who doesn't labor as much hacking WP themes can simplify what I'm posting...
    {{ DiscussionBoard.errors[746399].message }}
  • Profile picture of the author AlbertF
    I would say the most easiest way is to download widget logic and add tags. It will show widgets that you don't want to show on certain pages. Or if you are talking about relevancy for your Google Adsense, it really depends.
    Signature
    {{ DiscussionBoard.errors[746481].message }}

Trending Topics