Correct thumbails not used
-
My WordPress-installation has thumbnails enabled. I entered the size of these thumbnails in the settings, but the plugin (Version 2) uses the full-size version of the image (which gets downscaled with the height and width-parameters).
I use the same settings in your “Top 10” plugin. Here the correct thumbnails are used.
Is this a bug?
-
Hi,
If you’re using 2.0 of CRP, then the way the thumbnails are handled are a bit different from Top 10.
Check out my release post for details on thumbnails: http://ajaydsouza.com/archives/2014/09/12/contextual-related-posts-2-0/
Ideally you should run Force Regenerate Thumbnails to recreate the thumbnails to the correct size.
This new way isn’t perfect for me at all.
Because my “normal” thumbnail have exact the same size as the ones I use for the related post display. The result is, that I now have a second thumb named “crp_thumbnail” with the exact size as my normal post thumbnails already have.
Second: Normally my thumbails are not only smaller versions of the post image. With the plugin “Post Thumbnail Editor” I carefully choose the part of the image for the thumbnail.
So in my case I do not need another thumbail. I would like to use my already existing ones with the manually chosen picture area.
Additional thoughts:
The plugin should look in the WP-Settins, if the thumbnail size is the same as in the plugin-settings. If this is the case, there is no need to create a second thumbnail and the plugin should use the existing one.
Or there should be an option “Use existing post thumbails”. If this is selected the plugin should use the existing post thumbnails and not create new ones.
Gerobe, that’s the new option that I am working on for the next version of the plugin. To allow you to choose a pre-existing size.
For my knowledge, how do you normally use the correct position etc.?
From my testing, if you set the thumbnail dimensions in CRP to match the existing thumbnail size, then WordPress should just use that size which was created and not create a new one since it is size agnostic then.
You’ll need to see if there is a crop option set to soft proportional (default in CRP) or hard (you can turn it on in the settings page)
I just noticed, that there still is a field “Post thumbnail meta field name:”. In my case the entry was “post-image”. When I change this value to “crp_thumbnail”, the thumbnail created by the plugin is shown!
But I want “my” better thumbnail to be shown. I added “thumbnail”, but this did no change anything. What is the correct meta-value of the normal thumbnail? Maybe if I enter this value, it will show “my” normal post-thumbnail.
Hi,
Do you know the name of your thumbnail?
You might want to temporarily use a plugin like https://wordpress.org/plugins/display-registered-image-dimensions/ or https://wordpress.org/plugins/simple-image-sizes/
to view the image dimensions.Here is the list
thumbnail 53x40px
medium 220x165px
large 800x600px
vollebreite 532x200px cropped
wptouch-new-thumbnail 144x144px cropped
crp_thumbnail 53x40px croppedI changed the value to “thumbnail”, but still the thumbnail is not used.
I notice that there is a difference between thumbnail and crp_thumbnail with the latter being “cropped”.
Do you have the option “Crop Mode” enabled in my plugin.
I’ll need to release a update with some code changes in order to use an existing list rather than create a new one.
If you’re comfortable changing code, there could be a potential workaround that you can use to stop using crp_thumbnail and using thumbnail only. Let me know if you would like to do this and I can tell you what lines to change.
Yes, crop mode is enabled now, due to the fact, that my normal images do not reflect the thumb aspect ratio of 53*40. But it wasn’t enabled since the beginning.
No problem for me to change some code, as long as I don’t have to change it with every update.
You won’t need to update the code in the next version, though you might need to change the settings to select the thumbnail you want.
For the code changes. Delete / comment out line 1065:
add_action( 'init', 'crp_add_image_sizes' );Change Line 1138:
$postthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $result->ID ), 'thumbnail' );Change line 1216:
$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );Yes! This did the trick and “my” correct thumbnails are shown. Thank you!
You’re welcome. I’ll mark this as resolved for now.
Some additional info:
After changing the lines at first nothing had changed. I had to clear the cache of the plugin first, although there is the info that it is cleared automatically, when the settings are saved.
Than everything was correct with the correct thumbnails.
To check this I switched the code back and cleared the cache to make sure it wasn’t a caching problem, but it showed the “wrong” thumbnails again. So it was not a caching realted issue and the code changes have been necessary.
Thanks for confirming. The cache works by saving the entire output of the related posts so that no queries need to be made after the first load.
The topic ‘Correct thumbails not used’ is closed to new replies.