If post_meta = 1 do this, else do this
-
I’m trying to get a conditional statement running on a custom field I’ve collected.
If post_meta “testfield” = 1, do this
else if post_meta “testfield” = 2, do this.This is what I originally had, close but no cigar.
<?php if ( get_post_meta($post->ID, "testfield", true) ) { ?> <img src="image.jpg"/> <?php } ?>Any help appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘If post_meta = 1 do this, else do this’ is closed to new replies.