Archive for January, 2010

PHP random content on wordpress

I wanted to split test my post footer in Wordpress so I could try out two different Aweber forms. However the forms didn’t display in the way I wanted.
The code I ended up using:
$chosen = mt_rand(1,3);
switch($chosen){
case 1:
include ‘first.php’;
break;
case 2:
include ’second.php’;
break;
case 3:
include ‘third.php’;
break;
default:
echo ’something went horribly wrong’;
}
From: Random HTML snippets with PHP include?
This worked very well [...]

More »