Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show medium not full size of thumbnails in latest-posts block. #755

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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