if and statement with custom fields
-
Hi All,
I’m trying to test if 2 custom fields have info, it both have details, then display a message. My code below errors with
unexpected ‘:’
I thought I needed the : can someone please put me out my misery.
<?php if (get_post_meta($post->ID, "Address", $single = true && get_post_meta($post->ID, "Address2", $single = true) : echo 'both present'; endif; ?>
Many thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘if and statement with custom fields’ is closed to new replies.