• I’ve recently added WPML to my site but the widget displays top10 from the default (previously the only one) language.

    I’ve found couple of forum threads about this with various solutions but whenever I try to define a function from those solutions I get a PHP error “can not redeclare function” which means those functions are already in the plugin, so why isn’t it working then? ??

    Can’t find anything related to localization in the settings, so I guess it should work out-of-the-box with WPML.

    Using latest version of the plugin.

    https://www.ads-software.com/plugins/top-10/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ajay

    (@ajay)

    Avram, the current version of Top 10 does have basic support for WPML.

    Two things worth trying:

    Please see the gist : https://gist.github.com/ajaydsouza/9b1bc56cec79295e784c

    You should try the code as-is and also try it with return false

    You’ll need to put this in your theme’s functions.php file.

    Thread Starter Avram

    (@avram)

    Very strange. I placed it as is and it worked on the home page, but remained in original language on inner (category/post/page) pages (those use different sidebar and second instance of your plugin widget). Then I switched to false but it didn’t change anything so I reverted back to true.

    Now, couple of hours later, it again shows original language for both sidebars. I have double-checked, the code you linked is still in my theme’s functions.php file :S

    Plugin Author Ajay

    (@ajay)

    Could you please disable and clear the cache in the plugin settings page if this is enabled.

    Thread Starter Avram

    (@avram)

    Nope, that didn’t help ??

    Is it possible that it won’t work because the new language doesn’t have 10 posts yet? Stupid question, it should give what it has but I had to ask.

    btw. I’m a PHP dev so if you give me a hint where the widget code is located I might dig a little bit into that (though I don’t have any experience with WPML)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Top 10 widget and WPML’ is closed to new replies.