Hi!
You’re absolutely right; in the Prev/Next posts, featured image is not visible. In order to overcome this issue, add the following function in theme’s functions.php
file (or, if you have a plugin where you add your own customization, add it there):
function nelioefi_twentyfifteen_post_nav_background() {
if ( ! is_single() ) {
return;
}
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
$css = '';
if ( is_attachment() && 'attachment' == $previous->post_type ) {
return;
}
if ( $previous && uses_nelioefi( $previous->ID ) ) {
$css .= '
.post-navigation .nav-previous { background-image: url(' . esc_url( nelioefi_get_thumbnail_src( $previous->ID ) ) . '); }
';
}
if ( $next && uses_nelioefi( $next->ID ) ) {
$css .= '
.post-navigation .nav-next { background-image: url(' . esc_url( nelioefi_get_thumbnail_src( $next->ID ) ) . '); border-top: 0; }
';
}
wp_add_inline_style( 'twentyfifteen-style', $css );
}
add_action( 'wp_enqueue_scripts', 'nelioefi_twentyfifteen_post_nav_background', 99 );
Best,