php - Using OR in a IF -
any ideas why isn't working?
if($page->slug != 'water-filters' || $page->slug != 'pet-care' || $page->slug != 'books') { //do }
i think mean , instead of or because you're using not equals.
by using not equals in way statement true, if $page->slug equals 'water-filters' doesn't equal 'pet-care' , hence if statement whole returns true.
if($page->slug != 'water-filters' && $page->slug != 'pet-care' && $page->slug != 'books') { //do }
Comments
Post a Comment