I have a custom field in a WP post called "profession." If this profession is RN, then I want one piece of text displayed. If the profession is not RN, then I want another piece of text displayed.
I added the following code to execute this function:
<?php if ( $profession = 'RN' ) {
echo '<li>Minimum 2 years experience</li><li>Current license in this state</li><li>Graduated from accredited Nursing school</li><li>BCLS required</li><li>BSN and ACLS preferred</li><li>Other requirements to be determined by our client facility</li>';
} else {
echo '<li>Minimum 2 years experience</li><li>Other requirements to be determined by our client facility</li>';
} ?>
The problem is, the first echo statement is displaying even when the post does not have RN in the profession field. If I purposely break the if variable, then it defaults to the second echo statement across the board. I can't get the post to respond dynamically to one vs the other.
Am I missing something in this code that is causing one or the other to display for all instead of based on the parameter I am trying to set?