From 1f807c84c84c14242a8a44d923e83759ce5890ff Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Fri, 14 Oct 2022 11:45:25 -0300 Subject: [PATCH] Do not shows navigation thumbnail if no thumbnail is present. --- tainacan-blocksy/inc/navigation.php | 56 +- tainacan-blocksy/package-lock.json | 2010 ++++++++++++++++++++++++++- 2 files changed, 2027 insertions(+), 39 deletions(-) diff --git a/tainacan-blocksy/inc/navigation.php b/tainacan-blocksy/inc/navigation.php index 91863f7..d2bc2b4 100644 --- a/tainacan-blocksy/inc/navigation.php +++ b/tainacan-blocksy/inc/navigation.php @@ -61,23 +61,23 @@ if ( !function_exists('tainacan_blocksy_get_adjacent_item_links') ) { $next_thumb = get_the_post_thumbnail_url( get_next_post(), 'tainacan-medium' ); } - $previous_post_image_output = blocksy_simple_image( + $previous_post_image_output = $previous_thumb ? blocksy_simple_image( $previous_thumb, [ 'inner_content' => '', 'ratio' => '1/1', 'tag_name' => 'figure' ] - ); + ) : ''; - $next_post_image_output = blocksy_simple_image( + $next_post_image_output = $next_thumb ? blocksy_simple_image( $next_thumb, [ 'inner_content' => '', 'ratio' => '1/1', 'tag_name' => 'figure' ] - ); + ) : ''; } @@ -99,7 +99,7 @@ if ( !function_exists('tainacan_blocksy_get_adjacent_item_links') ) { '' . ($has_thumb ? $next_post_image_output : '') . ''); - + return ['next' => $next, 'previous' => $previous]; } } @@ -187,7 +187,6 @@ if ( !function_exists('blocksy_default_post_navigation') ) { ob_start(); ?> -