I want to set a conditional in header.php
to wrap all of my templates, except front-page.php
and single-device.php
, in a bootstrap container element.
Writing one conditional achives what I want
if( !is_singular('device') ) {
echo '<div class="container">';
}
However, when including two conditionals, only the first conditional applies.
if( !is_singular('device') || !is_front_page() ) {
echo '<div class="container">';
}
Is the logic incorrect?
AND
(&&
) operator, not theOR
(||
) operator.OR
operators need only one true to executeis_front_page()
check is somewhat faulty, depending on the context, see this answer for a alternative solution.pre_get_posts
, see here. Faulty is relative I guess...