Try
if ((!is_page('35')) && (!is_page('108')))
Michael,
Thank you. That works.
I don’t understand why the logic Operator AND is used instead of OR. Shouldn’t I be testing against one or the other argument?
Welcome to the ‘I don’t get that’ club!
It’s something to do with two NOTs require an AND…but I can’t really explain it other than it’s a rule to memorize 😉
Maybe a programmer (or logical person) will stop by and expand….
Don’t worry, I have dreams about PHP, and I get confused around those sorts of things too. Happens to everyone.
Well I thought about this over breakfast and I might understand…
When using OR, only one of the conditions has to be true, and because the first condition is true it doesn’t bother to test the 2nd condition.
So if the page is 108, then the first condition is met (not equal to 35) and it never tests the NOT EQUAL TO 108 portion.
U R Right Michael and may i add this (without being a programmer):
OR here means:
Either the first condition is NOT true || the second condition is NOT true
AND here means:
If first condition is NOT true && second condition is also NOT true
Just thoughts before lunch 😉
Thanks Everyone,
This has been informative and quite helpful and gives me a better understanding of PHP quirks (probably it is my logic that is quirky and not PHP’s).
It’s not a quirk of PHP. It’s actually the way pretty much all programming languages (at least all the important ones — LOLCODE doesn’t count) work.
Once you learn that logic, you can apply it to whatever programming language you choose later on.