Rotating text-link below every post

As part of my promise when I changed to version 5, I have included a text-link thingy at the end of every posts. This text-link thing will rotate, meaning that the computer will choose one line out of every line in the file to display. The good thing is that, this text-link can be used to link to other pages.

Thus, if you have a website that you feel should be allocated a space for the text-link in my blog, why not leave me a comment and I will see what I can do? Of course, if you are a Singapore entrepreneur with a website, I will be more than happy to give you a text link. After all, this is supporting Singapore’s talents right?

For those that wants to put a rotating text-link, I will include the code below. This code is useful if you have several ads that you want displayed on a rotating (random) basis. For example, you may want the computer to display google ads sometime and ad brite ads another time. This code will be useful!

$img = array();
$img[] =’
Code here
‘;
$img[1] =’
Code here
‘;
$img[2] =’
Code here
‘;

$max = count($img) – 1;
$count = rand(0,$max);

If you have more, you can change the numbers in the $img[] to become $img[3] or $img[4] and so on and so forth! Remember the first one is $img[] and not $img[1]!

At the end of this, put the following code

echo $img[$count];

enclosed with the standard php opening and closing < ? p h p as well as ? > without the spaces. Do enclose the code mentioned above with the php opening and closing too. I don’t know how to type code in wordpress because the php codes will disappear from the screen when i type the correct ones..(without the spaces)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s