if Statement yes or no
-
Hi I’m try to write an If statement for a custom field.
The custom field is called “multiple_listings” and it have 2 values that can be selected from a drop down menu, “Yes” or “No”
If “yes” is selected I want some HTML to appear.
If “no” is selected I don’t want anything to appear.So far I think the php needs to look something like this . . .
<?php
if ( get_post_meta($post_id, ‘multiple_listings’ = ‘Yes’) { ?>
HTML I want to appear
<?php } ?>I’ve tried several variations but I cannot get it to distinguish between the “yes” and the “no”
Can someone provide me with the correct code please.
Thanks in advance.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘if Statement yes or no’ is closed to new replies.