Hi,
You can try this code instead
function add_entry_navigation(){
if( is_single() || x_is_portfolio_item() ) {
$next_post = get_next_post();
$previous_post = get_previous_post();
the_post_navigation( array(
'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' .
'<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' .
'<span class="post-title">%title</span>' . get_the_post_thumbnail($next_post->ID,'thumbnail'),
'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' .
'<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' .
'<span class="post-title">%title</span>' . get_the_post_thumbnail($previous_post->ID,'thumbnail'),
) );
}
}
add_action('x_before_view_global__comments-template', 'add_entry_navigation' );
As this is all custom development, regretfully we wont be able to assist further. Custom development is outside the scope of our support. We are happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation. If you are not comfortable making further changes and if you require more customization on your site, it would be best to get in touch with a developer.
Thank you for understanding