Created
July 27, 2015 22:31
-
-
Save tripflex/f29594cdd5e3ce850186 to your computer and use it in GitHub Desktop.
Show image based on field selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$is_veteran = get_custom_field( 'is_veteran' ); | |
// Assuming the full URL to the image is //domain.com/banners/veteran.png | |
// if the value of the selection is "veteran" then it would form that full URL | |
if( ! empty( $is_veteran ) ){ | |
echo "<img src=\"//domain.com/banners/{$is_veteran}.png\"></a>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment