When it comes to speaking the language of PHP, I would say I'm around toddler level. I have a basic grasp and understanding of the structure and logic, and I can throw some words around here and there, but much of the proper grammar is lost on me. Plus, I can make things work without understanding exactly how they work, lol. So now you know what level I'm coming from.
I am working on a theme options page for WordPress. In the options panel, users can things "off" and "on." For example, they can control the column widths by entering a number of grid units (to correspond with the grid system the site uses). To disable a column they enter "0". If they enter "0" for BOTH column widths, I want to hide the ENTIRE div that wraps those two columns (to avoid having empty code). The following conditional is supposed to return TRUE only if BOTH columns don't equal zero. This is how I want it to work:
If LEFT COLUMN WIDTH does NOT equal zero AND if RIGHT COLUMN WIDTH does NOT equal zero....
Load left & right column container div.
Here's the conditional I have....
<?php if (get_option('cpress_topbar_left_column_width') !=0 && get_option('cpress_topbar_right_column_width') !=0) { ?>
<div class="container">....stuff...</div>
<?php } ?>
The problem is, the conditional is behaving like an "OR" statement. If I set one of the column widths to 0, it returns true and does not load the div. I want it to return true ONLY if BOTH columns are zero.
I've been fiddling with it for about an hour, adding parentheses and more, but can't figure out what I'm doing wrong. Thanks in advance for any insights.