WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
Thumbnails Options Using Wrong Thumbnails (7 posts)

  1. DanielBPV
    Member
    Posted 11 months ago #

    Thank you very much for this awesome plugin! It's the only one I've found that really gets the similarity between my posts right.

    One downside I've found, though, is that the "thumbnails" option isn't using the thumbnails. It's instead using a shrunken version of the actual picture. So, for instance, it's using:

    http://www.mysite.com/wp-content/uploads/2012/05/myimage.jpg

    instead of

    http://www.mysite.com/wp-content/uploads/2013/04/myimage-150x150.jpg

    Or some other variation on the square. This leads to:

    a) stretched images when they're not square
    and
    b) longer loading times, since it's loading the entire picture.

    Is there any solution to this? I'm happy to rewrite code.

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

  2. DanielBPV
    Member
    Posted 11 months ago #

    I've spent over an hour reading faqs, reading this forum, and tinkering with the settings.

    The problems seems to be that YARPP is simply not accessing my thumbnails. My theme has thumbnails enabled, and they work well in my archives. I use "Site Layout Customizer" to generate a front page, and it accesses my thumbnails fine.

    Somehow, though, YARPP isn't able to access my thumbnails, and so is just putting a shrunken version of the entire featured image in its place. This is slowing down my site quite a bit, since my site has a lot of art on it, and those files are huge.

    If i put the yarpp-template-thumbnail.php display option up, I don't get thumbnails at all. I simply get full-sized pictures! It should be accessing my thumbnails, and has "the_post_thumbnail();" written right into the code, but it is accessing the whole image instead.

    Would you please explain how I can get YARPP to access my thumbnails? I don't want to have to generate an entirely new set of thumbnails, just have it access the ones I already have. I'm going to have to turn off the thumbnails if this can't be fixed.

    Thank you again for the plugin. I wouldn't be raising this if I didn't want to use it.

  3. DanielBPV
    Member
    Posted 11 months ago #

    I've solved it. I've also found an elegant solution to the problem from this thread:

    http://wordpress.org/support/topic/yarpp-not-using-the-square-thumbnails?replies=15

    I went the opposite to the approach of generating thumbnails for YARPP, and instead made YARPP fit the thumbnails I already had.

    I went and rewrote one line of code in template-thumbnails.php:

    $post_thumbnail_html = get_the_post_thumbnail( null, $dimensions['size'] );

    and had instead:

    $post_thumbnail_html = get_the_post_thumbnail( null, 'thumbnail' );

    This solve the problem perfectly. Instead of trying to find or generate thumbnails that matched my YARPP settings, I had YARPP get the thumbnails that were already there. It simply grabbed my 150x150 thumbnail, shrunk it to 120x120 and tada!

    Please let me know if you have any questions. I think this would be an elegant solution to the thumbnail issues in future versions.

  4. chris055
    Member
    Posted 11 months ago #

    ^^ I was looking for this solution forever! Thank you!!

    After switching the code my website loads a lot faster now!

    Thanks dude!

  5. chris055
    Member
    Posted 11 months ago #

    Would it be safe to remove this lines also? (from template-thumbnails.php)

    $this->diagnostic_generate_thumbnails() )
        $this->ensure_resized_post_thumbnail( get_the_ID(), $dimensions );
  6. FrankCPhoto
    Member
    Posted 11 months ago #

    Thanks for this - I tried the solution above and it also works for me.

    My theme seems to have generated 120x120 and 150x150 thumbnails - yet YARPP still used a distorted resized version.

    Apart from this issue - have been happy with YARPP so far.

    Thanks once more.

    Frank

  7. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 10 months ago #

    Please read the info in the YARPP readme's FAQ section about setting the yarpp thumbanail size.

    You don't want to modify the files in YARPP itself, as they will be overwritten when you upgrade YARPP.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.