Skip to content

Instantly share code, notes, and snippets.

@MrThiemann
Created August 21, 2020 11:29
Show Gist options
  • Save MrThiemann/6a27491b9e6dfbac5233cdf52d3d51be to your computer and use it in GitHub Desktop.
Save MrThiemann/6a27491b9e6dfbac5233cdf52d3d51be to your computer and use it in GitHub Desktop.
Content
<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