This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: even when set a (non WP native) widget to only display in one language, it will appear in every language (YOOTheme theme)

Solution: please follow the instructions on: https://wpml.org/forums/topic/wmpl-widgets-only-one-language-not-working/#post-2865662

This topic contains 9 replies, has 2 voices.

Last updated by Alejandro 11 months, 3 weeks ago.

Assigned support staff: Alejandro.

Author Posts
October 18, 2018 at 2:55 pm #2828403

raoulA

Hi WMPL,

We are developing a website and when we want to have productcategorie widgets in the sidebar
(one for dutch and one for english).

But when we select a language in the widget to only be displayed on that language it doesn't work and shows both widgets in both languages.

Any thoughts on how to solve this?

Kind regards,

Frank

October 18, 2018 at 3:47 pm #2828610

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,
Welcome to WPML Support!
I'll do my best to help you solve this problem.

You have WPML Widgets which is no longer necessary since WPML 3.8.0 so i'd suggest you disable it and try to configure the widgets to the right languages again (screenshot: "Multilanguage Widgets.jpg" ).

Let me know how it goes, and don't hesitate to come back if the issue is not resolved yet.

October 24, 2018 at 12:57 pm #2846258

raoulA

Hi Alejandro,

I have disabled the plugin and tried again but it still gives the same result as before..

Kind regards,

Frank

October 24, 2018 at 1:19 pm #2846419

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

I'm sorry to hear that, could i ask you for site credentials and if i believe the problem has to be further tested in order to be fixed, could i ask for your permission to create a snapshot of your site (if need be)?

It will be deleted 1 day after the ticket is resolved.

I just enabled the correct fields for that, and the next answer will be private so only you and me will be able to see it.

I'll wait for the information.

October 25, 2018 at 9:13 am #2849183

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

I checked your site and ran a few tests. i tried to replicate the issue but the problem seems to be related to your theme so i would need a site snapshot if possible.
We usually recommend the free Plugin “Duplicator” for this purpose.

If you already know how Duplicator works (https://wordpress.org/plugins/duplicator/),
please skip the following steps and just send me the archive file you downloaded.

★ Duplicator Instructions
hidden link
https://wpml.org/faq/provide-supporters-copy-site/

If the file is too large (more than 400M), please use the Duplicator file filters to remove the cache, the wp-uploads directory, the media and the archive files.

Send me the link to the archive file (you probably want to use Google Drive, Dropbox, or similar services, as the snapshot file will be quite big).

Your next reply will be private, which means that only you and I will be able to see it and have access to it.

You can paste the link to the file there.

Once the problem is resolved I will delete the local site.

October 27, 2018 at 9:29 am #2854978

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

This is just a quick update on what i'm doing.

First of all, the entire process was slower than usual because the installation of your site took longer than expected.

After checking out your site i started wondering about a few things that might give me clues about the issue in hand.

1) Your wp-config.php file has the Multisite declaration line but your .htaccess is the same as the single installation. is this intentional?

2) The problem seems to exists only with WooCommerce widgets, all the other widgets work well without issues.

3) You're using "YooThemes" as a Parent Theme, and by reading the author's documentation i noticed that only "YooThemes Pro" is fully compatible with WPML, Can you confirm this theme is the same as YooThemes Pro? if not, could you install it on your site and let me know? (do not activate it, though)

4) There is a new update for the parent Theme (YooThemes), please update and let me know if the problem still remains.

In the meantime i'll keep debugging this issue which turned out to be quite tricky!

October 29, 2018 at 12:28 pm #2857888

raoulA

Hi,

1) It was not intentional to have it in the wp-config.php can we set it to false without having any problems?

3) We are using YooTheme Pro.

4) We have updated YooTheme but the problem still exists.

Kind regards,

Frank

October 30, 2018 at 4:01 pm #2862606

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

After checking everything out and after very long debug sessions, i found the problem seems to be an incompatibility problem between the theme and WPML.

I already forwarded the details to our Themes & Plugins Compatibility Team and they will contact the theme's author and try to solve the problem.

Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.

If you have any doubts, Don't hesitate to ask, i'll gladly do my best to help you out.

October 31, 2018 at 9:08 am #2864932

raoulA

My issue is resolved now. Thank you!

October 31, 2018 at 12:13 pm #2865662

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

Our Compatibility team got back to us with a solution to your problem:

1) Open "Widgets.php" which is found in the following path: wp-content/themes/yootheme/vendor/yootheme/theme/platforms/wordpress-widgets/src/.

2) Find the following line of code (line 126)

public function displayWidget($instance, $widget, $args)
    {

and right under it, add the following (in line 128):

if (!$instance) {
          return false;
        }

Then proceed to save the file and that will fix the problem.

Regards.