I need some help in writing a PHP conditional that will toggle between two ways of presenting a WordPress blog.
The problem isn't really about WordPress, just PHP logic.
It's probably quite simple, but I'd like to make sure of it before I hard-code it into my site.
In my WordPress PHP/HTML page, I have a MySQL query which fetches the value of a 'switch' which may be 'on' or 'off'. In other words it can be true or false:
//(earlier MySQL query...)
$ExcerptsEverywhere = true; //Can be true or false, depending on the result of an earlier query to the database.
In my WordPress PHP/HTML page, there is this line which is the beginning part of a conditional:
if ( is_search() ) : // Display Excerpts just for Search
<!-- etc - more HTML and PHP... followed by... -->
Now what I'd like to do is this: if $ExcerptsEverywhere returns from the query as false, I'd like the beginning part of the conditional to stay as it is above. However, if $ExcerptsEverywhere returns from the query as true, I'd like the conditional to be like this instead:
if ( is_search() || is_home() || is_category() ) : // Display Excerpts for Search and Homepage and categories
How can I recast the conditional to be in the correct form according to the true/false value of $ExcerptsEverywhere ?