Support » Plugin: WordPress Popular Posts » WPML Thumbnail Translate

  • Hello,

    I have been using WPML to translate my website from Japanese into English.

    I am having an issue with the ”wordpress popular posts” widget. The text translates into the correct language inside my blog sidebar but the thumbnail stays in the native language (Japanese).

    Please see link to the english page which is showing the Japanese thumbnails.

    I have spoken to WPML and they have ran tests and attempted to help but they can’t do anything. They advised I reach out here since it mentions that ”wordpress popular posts” is a WPML compatible plugin.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    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.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    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:

    1. Go to Plugins > Plugin Editor and select WordPress Popular Posts using the dropdown at the right of your screen to edit it.
    2. Click on src > Output.php to open this file.
    3. 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;
    4. 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:

    1. Go to Settings > WordPress Popular Posts > Tools.
    2. Under Data, set Ajaxify widget to Enabled, then click on the Apply button below to save changes.
    3. Finally, clear W3TC’s cache for changes to take effect.
    ruthais

    (@ruthais)

    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

    ruthais

    (@ruthais)

    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.

    ruthais

    (@ruthais)

    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

    Plugin Author Héctor Cabrera

    (@hcabrera)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.