Hi guys.
I'm trying to write some php so that, depending on the page displayed, a certain <div> will load a certain class, giving it a certain background image. I have it down in theory, but there's a problem. My current code is returning multiple results as true, leading to the user receiving source like:
In this instance, it is obviously supposed to be either class="flower-1" or class="flower-2".
Here's my php:
On the page designated "Bravo", I'm getting the conjoined "flower-1flower-2" problem. I don't know if any of this is clear at all, so I can help explain further if need be.
Thanks for reading!
I'm trying to write some php so that, depending on the page displayed, a certain <div> will load a certain class, giving it a certain background image. I have it down in theory, but there's a problem. My current code is returning multiple results as true, leading to the user receiving source like:
Code:
<div id="wrap" class="flower-1flower-2">
Here's my php:
Code:
<div id="wrap" class=" <?php if ($thisPage=="Home"||"Test") echo "flower-1"; if ($thisPage=="Bravo") echo "flower-2"; ?> ">
Thanks for reading!
Comment