When featured image is set html output is messed up
I installed the plugin and I was trying to use the thumbnail display function, I noticed the html output is wrong when a post has a featured image set.
this is how it looks when a post doest’ have any featured image, the thumbnails displays the default default.png
<a title="My post without featured image" href="http://www.mydomain.com/articles/no-featured-image/" class="yarpp-thumbnail"> <span class="yarpp-thumbnail-default"><img src="http://www.mydomain.com/wp-content/plugins/yet-another-related-posts-plugin/default.png"></span> <span class="yarpp-thumbnail-title">My post without featured image</span> </a>
and this is when a featured image is assigned to a post.
<a title="This post has a featured image" href="http://www.mydomain.com/articles/has-featured-image/" class="yarpp-thumbnail"></a> <a title="This post has a featured image" href="http://www.mydomain.com/articles/has-featured-image/"><img width="120" height="120" alt="wine cork art tray" class="attachment-yarpp-thumbnail wp-post-image" src="http://www.mydomain.com/wp-content/uploads/2013/08/wine-cork-art-tray-120x120.jpg"></a> <span class="yarpp-thumbnail-title">This post has a featured image</span>
I also tried other YARPP templates but the same thing happens.
So basically the Related posts are displayed all over the place instead of being neatly align, this is not a css problem.
Here’s a screenshot to show what’s going on, left featured images, right none
Your example showing a featured image has an empty link tag before a valid link tag. As a result, it’s displaying an empty box, which then pushes the other content over.
Any ideas why you are having two link tags for every post with a featured image? Can you deactivate other plugins to see if any are interfering? You might also deactivate and “delete” YARPP and reinstall it. The latest version (4.0.7) has clean uninstall that might clean up any problem data.
Let me know if that fixes it.
- The topic ‘When featured image is set html output is messed up’ is closed to new replies.