Skip to content

Commit

Permalink
Show medium not full size of thumbnails in latest-posts block. (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Nov 7, 2024
1 parent 812d264 commit 4b78a3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,16 @@ function sunflower_the_social_media_sharers() {
*
* @param boolean $styled_layout Is this a styled layout.
* @param boolean $caption Show the caption.
* @param boolean $is_block Is latest news block.
*/
function sunflower_post_thumbnail( $styled_layout = false, $caption = false ) {
function sunflower_post_thumbnail( $styled_layout = false, $caption = false, $is_block = false ) {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}

global $post;

if ( is_singular() ) :
if ( is_singular() && ! $is_block ) :
?>
<div class="post-thumbnail
<?php
Expand Down
2 changes: 1 addition & 1 deletion template-parts/content-archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php if ( has_post_thumbnail() ) { ?>
<div class="">
<a href="<?php echo esc_url( get_permalink() ); ?>" aria-label="Post Thumbnail" rel="bookmark">
<?php sunflower_post_thumbnail(); ?>
<?php sunflower_post_thumbnail( false, false, true ); ?>
</a>
</div>
<?php
Expand Down

0 comments on commit 4b78a3b

Please sign in to comment.