WordPress.org

Ready to get started?Download WordPress

Forums

Ad Injection
[resolved] Widget - HOW-TO inject multiple ad code snippits at random? (6 posts)

  1. exploremarsgreg
    Member
    Posted 2 years ago #

    Impressive plugin!

    We have a few dozen logo GIF's we want to display a subset of at random in the sidebar.

    The widget allows random rotation of ten ad-code snippits, and I've set up four that display four 260x60 logos successfully at random*. How do I configure the widget to display four "stacked" logos picked at random from the larger pool? For example, the first visit might generate C,Q,I,B, the next page or refresh T,X,A,C, the next one A,M,R,P, etc.

    If relevant, we're running 2.9.2 on the live site, 3.3.2 on my local "sandbox" development instance.

    *code sample: <img src="http://siteexample.org/sponsorlogos/260x50/exampleco-260x50.jpg" alt="Exampleco" title="Exampleco" width="260" height="60" />

    http://wordpress.org/extend/plugins/ad-injection/

  2. reviewmylife
    Member
    Plugin Author

    Posted 2 years ago #

    Hi exploremarsgreg, I've written about how to do this in the 'Randomly picking many adverts from a pool of ads' section of http://www.advancedhtml.co.uk/advert-by-wordpress-post-category/

    You'll have to put a bit of PHP code into the ad box and then store all the ads as txt files on your web server.

  3. exploremarsgreg
    Member
    Posted 2 years ago #

    You rock, RML.

    I'm waiting to get the advertising specifics from our management team.

    Cheers,
    Greg[ Signature moderated. ]

  4. doland
    Member
    Posted 1 year ago #

    Does this also apply to injecting 2 different ads in between paragraphs in posts and pages? Because I have it injecting 2 ads but both are always the same ads. I refresh but it gives me another ad, just injected 2 times. Is it designed to work that way? If so, would someone really want the same ad to display multiple times on the same page?

    How do I make it give me 2 (or more) random ads from my 5 ad codes?

  5. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Doland, It might surprise you but most people (90%+) want the same ad code in each position! This is because most people use AdSense. The same AdSense snippet is used for each position, but the JavaScript code gets a different ad.

    You can get closer to the behaviour you want by clicking on the 'Re-select an ad for each position on post'. This will randomly re-select an ad for each position. There's no guarantee it will pick a different one though!

  6. doland
    Member
    Posted 1 year ago #

    ahh, that explains it about using Adsense. And I will try the other tip. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags