WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
Image not displaying if there's no thumbnail url (1 post)

  1. soulplace
    Member
    Posted 1 year ago #

    Sometimes, for a lot of reason, happens that has_post_thumbnail returns true also if there's no thumbnail image. This could happen for an upgrade from a really old version of wordpress or if you have used some crappy plugin to autogenerate post thumbnail.
    In this case, this plugin (in thumbnail mode) tries to show an image that doesn't exist (but has a post thumbnail id).

    to fix that, i've simply added another check in if ( has_post_thumbnail()) in template_thumbnail.php file on row 45:

    $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    		if ( has_post_thumbnail() && $url>"")

    so, it checks also for the image url.

    this helped me a lot.

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic