Randomising content

Randomising content

Brogan

XenForo moderator
Staff member
Brogan submitted a new resource:

Randomising content - rand()

Randomising content can be used in various ways, the most common of which is for header images and logos, or advertising banners.

This guide will explain how it can be done simply with two lines of code (which ironically has taken a hundred lines of explanatory text).

For the purposes of this guide, we'll be adding a banner image in the Container header advertising position, which will randomly rotate between 5 different images.

Read more about this resource...
 

Craig Neff

Member
Nice ! Banner adverts typically have two components; the image ( which you have covered gracefully ) and the a href link to the site being advertised ... can those be added easily to the front of the code or does some other magic need to happen ?
 

Craig Neff

Member
in the case of advertising banners, each image will have a unique a href. how can we couple the a href with each image ?
 

Brogan

XenForo moderator
Staff member
If each banner has a different URL then it will require a different approach.

Not difficult but I'll put together another guide for that.
 

Craig Neff

Member
the man good job GIF by Playboy Fragrances
 

Brogan

XenForo moderator
Staff member
Top