Created
August 21, 2020 11:29
-
-
Save MrThiemann/6a27491b9e6dfbac5233cdf52d3d51be to your computer and use it in GitHub Desktop.
Content
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
<div class="druckerimage"> | |
<?php $image = get_field('image'); | |
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false, '' ); | |
if( has_post_thumbnail() ) { | |
echo '<figure class="gesamt">'; | |
the_post_thumbnail('medium'); | |
echo '<figcaption>'.the_field( 'image_description' ).'</figcaption>'; | |
echo '</figure>'; | |
} | |
elseif( !empty($image) ) { | |
echo '<img src="' .$src[0].' " alt="'. the_field( 'modell' ).'" class="druckerimg" />'; | |
echo '<figure class="gesamt">'; | |
echo '<figcaption>'.the_field( 'image_description' ).'</figcaption>'; | |
echo '</figure>'; | |
} | |
else { | |
echo '<figure class="gesamt">'; | |
echo '<img src="'. the_field('image').' " alt="'. the_field( 'modell' ).'" class="druckerimg" />'; | |
echo '<figcaption>'.the_field( 'image_description' ).'</figcaption>'; | |
echo '</figure>'; | |
} | |
?> | |
</div> | |
<!-- /** Content */ --> | |
<?php the_content(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment