You could use the OR operator..
<?php if( !is_page('new-moon') || !is_page(old-moon') ) {
get_sidebar();
}
?>
Don’t know if WP has a shortened version where you could use an amperstand within the is_page possibly…
EDIT: Yes you can, here is a more simplfiied version:
<?php if( !is_page('new-moon','old-moon') ) {
get_sidebar();
}
?>
Just seperate them via commas. More info here
Thread Starter
udt123
(@udt123)
Thanks for your help xdesi!
I tried both codes but it does not work for some reason. Do you think it might have something to do with my theme? the not equal to function works very well with only 1 page, but I have been trying for hours to get it work for 2 with no avail.Thank you for your time.
D
Sorry on further inspection it should be:
<?php if( !is_page(array('new-moon','old-moon')) ) {
get_sidebar();
}
?>
Thread Starter
udt123
(@udt123)
Thx for all your help and your time xdesi. It worked perfectly =)
D