• Resolved ttm2017

    (@ttm2017)


    Hi, I have a website in both English and Spanish. The WordPress Popular Posts plugin is filtering the most popular posts for each language (i.e. the most popular English posts are showing on the English pages, and the most popular Spanish posts on the Spanish pages), however all the thumbnail images are in English! So on my Spanish pages I have the title of the post in Spanish, and the correct link to the post in Spanish, but the thumbnail image in English. I need to include the thumbnail images – is there any way to correct this problem? Thanks!

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hola @ttm2017,

    While WordPress Popular Posts provides support for Multisite, the plugin hasn’t been fully tested on it and bugs/unintended behavior is to be expected (related FAQ: Can WordPress Popular Posts run on WordPress Multisite?)

    With that being said, it’s been a while since I last checked the parts of the code that integrates the plugin with Multisite but I’m 90% sure that -as you already noticed- the plugin uses the thumbnail of the original article (the english version, in your case) because WPP assumes it’s the same image for both the original article and its translation. It didn’t really occur to me at the time that people also add texts to their images.

    Anyways, unfortunately there isn’t a quick & easy solution for this right now (not off the top of my head at least.) I’ll have a look at the code as soon as I can and see what I can come up with. For the time being you’ll have to disable thumbnails and keep an eye on this topic for updates.

    Thread Starter ttm2017

    (@ttm2017)

    OK, thanks!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Oh, I just re-read what I posted and realized that the initial part of my comments is way wrong haha. I must have been more tired than I thought I was when I replied.

    Anyways please forget about the whole “Multisite” thing, that has nothing to do with your issue. The rest of my comments is spot on though. Which multilingual plugin are you using, @ttm2017?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @ttm2017,

    Please try this:

    1. Go to Plugins > Editor and pick WordPress Popular Posts from the dropdown.
    2. Click on includes/class-wordpress-popular-posts-output.php to edit this file.
    3. Find:
      
      // Thumbnail
      $post_thumbnail = $this->get_thumbnail( $post_object );
      

      and change it to:

      
      // Thumbnail
      $original_id = $post_object->id;
      $post_object->id = $post_id;
      $post_thumbnail = $this->get_thumbnail( $post_object );
      // Restore original ID
      $post_object->id = $original_id;
      
    4. Click on Update file to save changes.
    5. If you’re using a caching plugin, flush its cache now.

    I haven’t tested this code but I believe it should work. Give it a shot and let me know how it goes, alright?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Marking as resolved due to inactivity.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying popular posts on a multilingual site’ is closed to new replies.