mercredi 1 avril 2015

Wordpress featured image size uniform height

I am setting featured images to posts, and displaying a default image if one isn't set. My code is here...



<?php if ( has_post_thumbnail() ) {
the_post_thumbnail( 'full', array( 'class' => 'img-responsive' ) );
} else { ?>
<img src="default-image.jpg" class="img-responsive" />
<?php } ?>


Problem is simple. All of the images are different heights. I want them all to be uniform height so my bootstrap grid lines up evenly.


Any thoughts? Lots of examples online but none work with featured image AND default image.


Aucun commentaire:

Enregistrer un commentaire