Hi @ruthais,
Unfortunately right now there’s no way to have WPP return the Japanese version of the thumbnail. The plugin -as you already notice- will use the one from the English version of the post.
I may be able to lend you a hand with this sometime this upcoming weekend though. That’s the best I can offer at the moment. Would that work for you?
Yes that is great, thanks. Please note that the language problem is the other way around. Japanese is the main site language and the Japanese thumbnails are showing on the English side.
Hi @ruthais,
Please note that the language problem is the other way around. Japanese is the main site language and the Japanese thumbnails are showing on the English side.
Yep, my bad. The issue is still the same though: the plugin is fetching the thumbnail from the original Japanese post and not the one from the English version.
So I have changed the way WPP retrieves the thumbnail for posts with translations so every version can have their own thumbnail. Unfortunately I can’t release a new version of the plugin just yet because there are other things I want to work on / get done before v5.3 is ready for general use.
For the time being here’s a workaround:
- Go to Plugins > Plugin Editor and select WordPress Popular Posts using the dropdown at the right of your screen to edit it.
- Click on src > Output.php to open this file.
- Find these two lines of code (around line 287):
// Thumbnail
$post_thumbnail = $this->get_thumbnail($post_object);
and change that to:
// Thumbnail
$original_post_ID = $post_object->id;
$post_object->id = $post_id;
$post_thumbnail = $this->get_thumbnail($post_object);
$post_object->id = $original_post_ID;
- When you’re done, click on Update File to save changes.
That should do the trick.
Also, while you’re at it, since you’re using the W3 Total Cache plugin you’ll want to make sure to enable the Ajaxify widget feature to keep your caching plugin from caching your popular posts list:
- Go to Settings > WordPress Popular Posts > Tools.
- Under Data, set Ajaxify widget to Enabled, then click on the Apply button below to save changes.
- Finally, clear W3TC’s cache for changes to take effect.
Hello,
I have tried doing this and pressed save and now my whole site doesn’t work.
It is saying ”fatal error”
Please can you urgently advise what to do since my site is now inactive and I need to get it back online asap as many visitors are using the site every day.
Ruth
The error message says:
Fatal error: Uncaught Error: Class ‘WordPressPopularPosts\Output’ not found in /home/balloo20/public_html/bappashota.com/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php:36 Stack trace: #0 /home/balloo20/public_html/bappashota.com/wp-content/plugins/wordpress-popular-posts/src/Container/Container.php(104): WordPressPopularPosts\Container\WordPressPopularPostsConfiguration->WordPressPopularPosts\Container\{closure}(Object(WordPressPopularPosts\Container\Container)) #1 /home/balloo20/public_html/bappashota.com/wp-content/plugins/wordpress-popular-posts/src/Container/Container.php(88): WordPressPopularPosts\Container\Container->WordPressPopularPosts\Container\{closure}(Object(WordPressPopularPosts\Container\Container)) #2 /home/balloo20/public_html/bappashota.com/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php(44): WordPressPopularPosts\Container\Container->offsetGet(‘output’) #3 /home/balloo20/public_html/bappashota.com/wp-content in /home/balloo20/public_html/bappashota.com/wp-content/plugins/wordpress-popular-posts/src/Container/WordPressPopularPostsConfiguration.php on line 36
I can no longer also log into my wp-admin page. Please can you help urgently, I am extremely worried that the whole site has disappeared.
I have managed to recover the site. I don’t want to touch the coding again, I will wait till the new update is released. Thank you
Hi @ruthais,
Sorry you had to experience that. Nothing in the code I shared earlier would cause it though, from the error code it sounds as if the Output.php file you were editing got corrupted somehow? Anyways, glad to know you were able to sort things out.
I made some progress with version 5.3 recently so hopefully it’ll be out soon.