I managed to display the thumbnails for the previous and next post on my custom post type but I keep getting this error
"Notice: Trying to get property of non-object in C:\xampp\htdocs\tba\wp-content\themes\artikulo-uno\single-news_press.php on line 137"
I tried researching it but found no luck for a fix on my problem. Here is the code I have been working on.
Show thumbnail of previous post
<?php $prev_post = get_previous_post(true); $prev_thumbnail = get_the_post_thumbnail ( $prev_post->ID, array(100, 100) ); previous_post_link( $prev_thumbnail . '%link', '<span class="prev-link"> <span>Previous Post</span> <br/> %title </span>' ); ?>
Show thumbnail of next post
<?php $next_post = get_previous_post(true); $next_thumbnail = get_the_post_thumbnail ( $next_post->ID, array(100, 100) ); next_post_link( $next_thumbnail . '%link', '<span class="next-link"><span>Next Post </span><br/> %title </span>' ); ?>