WordPress.org

Ready to get started?Download WordPress

Forums

Contextual Related Posts
[resolved] Wrong Post Thumbnail Size on update (11 posts)

  1. Dannyroberts
    Member
    Posted 1 year ago #

    Hello,
    I'm fairly new to wordpress (my second month using it.)
    My site isn't up yet. I'm currently running a local installation.
    I added a post thumbnail size to my theme called "Related-thumbs" that is 142px by 210px. It was working fine as my thumbnail size for this plugin, until a two days ago when i upgraded wp to 3.5 and all my plugins.
    Now the thumbnails are 150px by 150px.
    Spent the last few days trying to figure out how to get it back working, but haven't had any luck fixing it.

    Thank you for your help.

    http://wordpress.org/extend/plugins/contextual-related-posts/

  2. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Are you talking about the thumbnails being displayed in the Related Posts lists?

    This new version works with post thumbnails differently. I'm planning on releasing a new update which stops doing the automatic resizing with timthumb.

    You can also change the settings of the thumbnail sizes in the Settings > Related Posts > Output Options tab

  3. Dannyroberts
    Member
    Posted 1 year ago #

    Thank you for your response. :)
    Yes, i'm talking about Related Posts lists.
    I have the thumbnail height set to 210px and width set to 142px in the output options. but the thumbnail being displayed on is 150px by 150px.
    not sure what to do to get it back displaying the way it was before i updated.

  4. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Please post the URLs of your site and where you are seeing this behaviour

  5. Dannyroberts
    Member
    Posted 1 year ago #

    The site is not online yet, it's just running on a local installation right now. So i'm not sure of what's the best way to show you, besides screenshots. which i know you probably need to see the code. so let me know if you know a better way for me to show you it. below is a link to two screenshots of what it look liked before and what it looks like now. thank you for taking the time to help.

    Before Update, and After Update

  6. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    I think there might be a bug in the code.
    Few questions to verify that I am correct:

    1. Are the images in your screenshot, "featured images" set when editing the post?

    2. What are the Thumbnail settings you have under Settings > Media ?

  7. Dannyroberts
    Member
    Posted 1 year ago #

    1. Yes they images are "featured images".
    2. My thumbnail settings were the normal default settings. 150px by 150px. than when they started displaying wrong, i tried changing them to 142px by 210px to see if it made a difference. When it didn't fix the problem i switched it back to 150px by 150px.

  8. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    From what I understand, WordPress does not automatically resize old thumbnails.
    You need to use some plugin like https://wordpress.org/extend/plugins/regenerate-thumbnails/

    I'm working on a new version which should ideally fix this problem.

    For now, can you try this and let me know if it works:

    Edit line 442 of contextual-related-posts.php

    $postimage = wp_get_attachment_image_src( get_post_thumbnail_id($result->ID), 'full' );

  9. Dannyroberts
    Member
    Posted 1 year ago #

    Brilliant! Wow thank you so much!
    I edited the line 442 like you said, and it changed all the thumbnails to the full post-thumnail. So i changed 'Full' to
    'Related-thumbs' which was the post-thumnail i was using and it worked like a charm. thank you so much! :)

  10. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    So, is this your new code?

    $postimage = wp_get_attachment_image_src( get_post_thumbnail_id($result->ID), 'Related-thumbs' );

  11. Dannyroberts
    Member
    Posted 1 year ago #

    yep exactly! thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic