WordPress.org

Ready to get started?Download WordPress

Forums

Featured Post Widget
[resolved] Full image is displayed instead of thumbnail (13 posts)

  1. Kerfred
    Member
    Posted 1 year ago #

    Hello,

    Congratulations for your plugin. It is very easy to use.
    I just have a problem.
    The thumbnail file is not used. Instead the image at full size is displayed in the widget.
    I only specified the size of the image (150) and keep all other parameters by default.

    http://wordpress.org/extend/plugins/post-feature-widget/

  2. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    thanks for the compliments. It's alway good to know, people like what you do. But I think I can't reproduce your problem. Or I missunderstand.

    What the plugin does, is taking the featured image of a post, if there is no width given. As soon as you change the size of the image shown, will be counted upon display and the middle-sized image of the attached image of that post is taken and sized down.

    But it should be sized down. So if your thumbnails are 150px wide, there is actually no need to give a size in the widget.

    Do you have a URL for me? That I could check out, whether or not the plugin is behaving as it should.

    Cheers

  3. Kerfred
    Member
    Posted 1 year ago #

    When we upload an image, it automatically resizes it to several sizes: thumbnail, medium and large. When we attach an image as a thumbnail post, normally it uses the thumbnail size of this image.
    For example, my original image is named my_image.jpg. The thumbnail size is automatically named my_image-150x150.jpg.
    I think that it will be the best for your plugin if it uses the thumbnail size. You can use the get_the_post_thumbnail function:
    http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
    with 'thumbnail' as the size parameter.

  4. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    I know that, but the thumbnails have to be resized from time to time. That's what the users want. If you don't want that and you want to fall back on the original thumbnail size, just leave the field for the width empty. And the plugin does the rest.

  5. Kerfred
    Member
    Posted 1 year ago #

    Even if the width field is empty, the thumbnail size is not taken. It always takes the full size of the image.
    To work for everyone, an idea would be to select the size of the image we want to take (thumbnail, medium, large or full). The actual behavior is always full.

  6. Kerfred
    Member
    Posted 1 year ago #

    To get the thumbnail with the thumbnail size, I did this modification.
    In FP_WidgetClass.php, I just replaced:
    $fpw_img_tag = get_the_post_thumbnail();
    by:
    $fpw_img_tag = get_the_post_thumbnail($post->ID, 'thumbnail');
    And that works.

  7. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    The function always did the job without parameters in my testing environments. Therefore, I never encountered your problem (and still don't). I change most of my plugins at the moment anyway and will include your suggestion in the next run for the Featured Post Widget. Thanks a lot for your help.

  8. Kerfred
    Member
    Posted 1 year ago #

    To reproduce the problem:
    - Edit a post
    - Set a featured image (take a big image)
    - Use your widget with this post

  9. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    I cannot reproduce the problem: Since this is the way I work all the time. Even in my two live environments the problem never occours.

    But as said, I will implement your changes in all my plugins to make sure that the two or three people that have that problem AND tell me ebout it, get rid of it.

    Once again, thanks a lot for your help.

  10. nwisg
    Member
    Posted 1 year ago #

    Just FYI, I am experiencing the same problem as Kerfred. I will use his fix. Thanks Kerfred.

  11. nwisg
    Member
    Posted 1 year ago #

    For my particular purpose I made these changes below

    I added this to my functions.php

    if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'feature-post-thumb', 200, 9999 ); //300 pixels wide (and unlimited height)
    }

    In FP_WidgetClass.php I replaced

    $fpw_img_tag = get_the_post_thumbnail();

    with

    $fpw_img_tag = get_the_post_thumbnail($post->ID, 'feature-post-thumb');

  12. rjlhughes
    Member
    Posted 1 year ago #

    I'm also having the same problem - and don't want to edit php files - is there another workaround?

  13. tepelstreel
    Member
    Plugin Author

    Posted 1 year ago #

    Hello all,

    thanks for reporting these errors. I still can't reproduce the above mentioned behaviour, but a solution might be near. I started the updating process for all plugins and I am making some changes to avoid full size images.

    The Featured Post Widget is about to be changed at the moment and gets some more functionality along with (hopefully) getting rid of having unwanted full size images.

    Unfortunately, I have a lot of work in my dayjob at the moment and I am a bit slow ;)

    Regards,
    Stefan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.