I have a really simple question about PHP conditional logic. I have some code where I want to load a different header file based on the post category type. The code below works:
if(in_category('news')) {
get_header('tertiary');
}
elseif(in_category('events')) {
get_header('tertiary');
}
else {
get_header('secondary');
}
But when I try to simplify the code to:
if(in_category('news' || 'events)) {
get_header('tertiary');
}
else {
get_header('secondary');
}
The tertiary header file for the events is not loading, it is showing the secondary header file. I'm using similar code elsewhere in my theme and it is working with no issues. So I'm not sure why it is not working here. I'm not getting an errors in my PHP console.