I am working on a website on WordPress and I’m getting an undefined variable in image url. WordPress automatically links to a random previous post with a picture from that previous link if there is a previous post but this notice keeps popping up on the bottom of my latest post. This does not show up on any other post. It says there is something wrong with the previous post image url. Since it is undefined should I try to define it in the code and include a url and image url from one of my previous posts to see if that works? This is where it says the error is on. And if I do define it myself, what is the code that I should input to create a variable for image url?
previous_post_link( '%link', '<div class="post-navigation-image"><img src="' . $previous_post_image_url . '" /></div><div class="post-navigation-content"><div class="post-navigation-title"><span class="next-post">Next Post ></span><h3>%title</h3></div></div>' );
echo '</div>';