diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php
index 92e7909..3541a44 100644
--- a/src/functions/single-functions.php
+++ b/src/functions/single-functions.php
@@ -169,10 +169,10 @@ function tainacan_get_adjacent_item_links($thumbnail = null) {
//Get the thumnail url of the previous and next post
if (function_exists('tainacan_get_adjacent_items') && isset($_GET['pos'])) {
if ($adjacent_items['next']) {
- $next_thumb = $adjacent_items['next']['thumbnail']['tainacan-small'][0];
+ $next_thumb = isset($adjacent_items['next']['thumbnail']['tainacan-small'][0]) ? $adjacent_items['next']['thumbnail']['tainacan-small'][0] : false;
}
if ($adjacent_items['previous']) {
- $previous_thumb = $adjacent_items['previous']['thumbnail']['tainacan-small'][0];
+ $previous_thumb = isset($adjacent_items['previous']['thumbnail']['tainacan-small'][0]) ? $adjacent_items['previous']['thumbnail']['tainacan-small'][0] : false;
}
} else {
$previous_thumb = get_the_post_thumbnail_url( get_previous_post(), 'tainacan-small' );
@@ -183,11 +183,13 @@ function tainacan_get_adjacent_item_links($thumbnail = null) {
$previous = $previous_link_url === false ? '' :
'' .
' ' .
- $previous_title . '' .
+ $previous_title . '' .
+ ($previous_thumb !== false ? '' : '') .
'';
$next = $next_link_url === false ? '' :
'' .
- '' . $next_title .
+ ($next_thumb !== false ? '' : '') .
+ '' . $next_title .
' ' .
'';
break;