Created
August 27, 2012 01:13
-
-
Save davemac/3484845 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