Compound PHP statement not working -


i'm having issues getting bit of code working. want if page loads template, , 1 of 4 possible categories specified execute action.

if (is_page('combined-feed') , ($event_category=='179' ||      $event_category=='180' || $event_category=='181' ||      $event_category=='1028'))  {     $description = "description goes here";  } 

i tried using structure similar found in this thread, have had no luck getting meet criteria of if statement. know there's going wrong or statements, haven't been able figure out how structure code better.

update: turns out there nothing structurally wrong code, had issue if statement.

i write code way

if (is_page('combined-feed') && ($event_category=='179' ||      $event_category=='180' || $event_category=='181' ||      $event_category=='1028'))  {     $description = "description goes here";  } 

in way, || operators evaluated first , 'and' operator last, because 'and' has lower precedence '||'.

see php operator precedence


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -