Adjustments on grid view mode to force cropped version of image.
This commit is contained in:
parent
064bc3c590
commit
a5229b0489
|
@ -21,19 +21,33 @@
|
|||
display: block;
|
||||
text-decoration: none !important;
|
||||
|
||||
.thumbnail-container {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f6f6f6;
|
||||
.grid-item-thumbnail {
|
||||
width: 255px;
|
||||
height: 255px;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
margin: 0;
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
.skeleton {
|
||||
width: 255px;
|
||||
height: 255px;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
background-color: #e0e0e0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 255px;
|
||||
max-height: 255px;
|
||||
width: auto;
|
||||
width: 255px;
|
||||
height: 255px;
|
||||
height: auto;
|
||||
border-radius: 0px;
|
||||
margin-bottom: -5px;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -9,11 +9,19 @@
|
|||
<?php the_title(); ?>
|
||||
</p>
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="thumbnail-container">
|
||||
<div
|
||||
style="background-image: url(<?php the_post_thumbnail_url( 'tainacan-medium' ) ?>)"
|
||||
class="grid-item-thumbnail">
|
||||
<?php the_post_thumbnail( 'tainacan-medium' ); ?>
|
||||
<div class="skeleton"></div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div
|
||||
style="background-image: url(<?php echo get_template_directory_uri() . '/assets/images/thumbnail_placeholder.png'?>)"
|
||||
class="grid-item-thumbnail">
|
||||
<?php echo '<img alt="Thumbnail placeholder" src="' . get_template_directory_uri() . '/assets/images/thumbnail_placeholder.png">'?>
|
||||
<div class="skeleton"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
|
||||
|
|
Loading…
Reference in New Issue