-
-
Save jamiemitchell/27eca23f02f7db80ca39f05c0b64f906 to your computer and use it in GitHub Desktop.
Check if ACF fields exists
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 elseif ( has_post_thumbnail() ) : | |
$featured_image_link = ( get_field( 'featured_image_links_to' ) ); | |
if ( $featured_image_link ) { | |
echo '<a href="'.get_permalink($post_object->ID) .'">'; | |
if ( has_post_thumbnail()) { the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); } | |
echo '</a>'; | |
} else { | |
the_post_thumbnail( 'hero-image-medium', array( 'class' => 'large fx' ) ); | |
}; | |
endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment