This file contains hidden or 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 | |
| $image = get_field('image'); // assigns the image field to the variable of $image | |
| if( !empty($image) ){ ?> <!-- if the $image variable isn't empty, display the following: --> | |
| <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <!--displays the URL for the image variable and also the alt tag which is entered in the WordPress media library--> | |
| <?php }; ?> <!--ends the if statement --> |