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

Display ads only if the post title contains certain keywords

Discussion in 'Blogging' started by egomOnia, Mar 8, 2010.

  1. egomOnia

    egomOnia Registered Member

    Joined:
    Oct 21, 2009
    Messages:
    92
    Likes Received:
    62
    How can I display ads in relation to a certain keyword in the post title using wordpress?

    It's easy to display ads in certain categories only or only if the post contains certain tags. But I need a way to target ads based on a keyword in the post title.. example:

    "Top 10 Acne Home Remedies" -> acne -> show anti acne products only
    "Wart Removal Tips" -> wart -> show anti wart products only

    Can anyone help me on how to do this?
     
  2. ghettogong

    ghettogong Regular Member

    Joined:
    Oct 7, 2009
    Messages:
    299
    Likes Received:
    28
    hey man, thats sound good when you are autoblogging and dont control what you post. I am trying to find that plugin too...

    by the way i am also looking for that plugin to show ads based on categories, you said its easy?
    Posted via Mobile Device
     
  3. egomOnia

    egomOnia Registered Member

    Joined:
    Oct 21, 2009
    Messages:
    92
    Likes Received:
    62
    No need for a plugin. Here's a simple way how to achieve the desired functionality:

    Code:
    <?php if (in_category('category-slug-1')) { ?>
    your ad code for category 1
    <?php } elseif (in_category('category-slug-2')) { ?>
    your ad code for category 2
    <?php } elseif (in_category('category-slug-3')) { ?>
    your ad code for category 3
    <?php } else { ?>
    leave blank or insert general ad code for categories not determined above
    <?php } ?>
    
    Place it wherever needed. Put it in your theme's template or use a php ready widget.

    Using category specific ads you can already target your advertising efforts quite well to increase conversions. I'm using methods like this one for all my autoblogs.

    If I could help you, please hit the thanks button. :rolleyes:
     
    • Thanks Thanks x 2
  4. ghettogong

    ghettogong Regular Member

    Joined:
    Oct 7, 2009
    Messages:
    299
    Likes Received:
    28
    Thanks given 4 sure!

    Only, if i wanted to show ads below the post were would i paste the code?
     
  5. mbceo

    mbceo Junior Member

    Joined:
    Feb 9, 2009
    Messages:
    164
    Likes Received:
    25
    Find this code in the single.php file:

    And then add the above ad code right below it.
     
    • Thanks Thanks x 1
  6. lhurey

    lhurey Newbie

    Joined:
    Sep 30, 2009
    Messages:
    46
    Likes Received:
    219
    How to do this on pages like www*domain*com/about-us/ and
    www*domain*com/about-us/contact-us
     
    Last edited: Mar 20, 2010
  7. reinie

    reinie Elite Member

    Joined:
    Jan 16, 2009
    Messages:
    1,574
    Likes Received:
    1,040
    Which ads are you guys talking about here?
     
  8. muchacho

    muchacho Supreme Member

    Joined:
    May 14, 2009
    Messages:
    1,293
    Likes Received:
    187
    Location:
    Lancashire, England.
    You need the Wordpress plugin called 'Advertising Manager'

    Simply create the ad by adding the necessary code and then choose how the Ad will be displayed: only by category, tags, posts/pages or all.

    You can even create 2+ Ads with the same name and have them auto rotate.

    For example, create 10 Ads all called MyAd and set the max number to be displayed to 1... it'll then show 1 of the 10 randomly each time the page is loaded.
     
  9. adbox

    adbox Power Member

    Joined:
    May 1, 2009
    Messages:
    658
    Likes Received:
    107
    Home Page:
    Hi man,

    I've a a software solution that does just that:

    1. place ads by keywords detected in content (title & postbody).
    2. place ads by keywords detected in referrer url.
    3. place ads by post/page id
    4. place ads by category
    5. place ads targeting google traffic only.
    Now I actually have two plugins that can do this. WP Traffic Tools, (http://www.wptraffictools.com) which is this plus a handful of other powerful features and a lighter version that only handles the advertising (http://www.thebestadvertisingplugin.com)

    Both commercial. WPTT = 57.00 but worth it. TBAP = 10.00 and worth it.