I am trying to modify some code on my website.
I have a variable $thumbnumber. Currently it is
Code: Select all
$thumbnumber=1;I am using wordpress and after the third time $thumbnumber is called by wordpress I need the value of $thumbnumber to change to 2.
After the sixth time $thumbnumber is called I need the value of $thumbnumber to change to 3.
Here is my current code, that is not working.
Code: Select all
$dug=1;
if ($dug == "1,2,3") {
$thumbnumber=1;
$dug++;
}
elseif ($dug == "4,5,6") {
$thumbnumber=2;
$dug++;
}
else {
$thumbnumber=3;
}
When I run the code, it just leaves the value as 1 even though $thumbnumber is called nine times.
I also tried using do while, but it was way too slow.