Skip Navigation

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 topic contains 15 replies, has 2 voices.

Last updated by a.m.L 4 years, 10 months ago.

Assisted by: Lauren.

Author Posts
January 17, 2020 at 1:47 pm #5312405

a.m.L

Trying to use a custom function to display terms is not working in second language.

January 18, 2020 at 12:31 am #5314387

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I had one of our developers review the code you shared and here is his suggestions:

Try using the 3rd argument, return_original_if_empty

$child_id = apply_filters( 'wpml_object_id', $child_id, 'merk', true );

and/or maybe specify the taxonomy?

$link = get_term_link($child_id, 'merk');

Please let me know if this resolves the error for you.

January 20, 2020 at 9:50 am #5321957

a.m.L

Hello, fixed on some terms, still error on some terms
For example: hidden link

January 20, 2020 at 1:02 pm #5323469

a.m.L

Hi Lauren,

Thanks for your help!
As I mentioned before, your advice helped me to fix the issue somewhere but it didn't solve the issue completely.

e.g. Porshe hidden link it still crashes. Check pls the error it gives me: hidden link

Looking forward to hearing you back

January 21, 2020 at 6:01 pm #5335425

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I just tested the link you shared in an incognito browser and I am not seeing the error. Can you please try clearing your cache and check again? Please see my attached screenshot.

Screen Shot 2020-01-21 at 12.57.37 PM.png
January 22, 2020 at 9:00 am #5338773

a.m.L

The reason you don't see the error because I turned off the debug mode. I turned that on before to show you what the error it gives me.
Anyway, the page is still crashed - this is a case.

January 22, 2020 at 4:28 pm #5342783

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Please see my previous private reply and let me know once the migration is completed. Thanks!

January 23, 2020 at 11:01 am #5347603

a.m.L

Hi, done.

January 23, 2020 at 2:00 pm #5349699

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Thanks for migrating the site. It seems that your errors are coming from your custom code in the functions.php file. When I switch to a default theme and view the standard WooCommerce category pages, I do not see any errors. Please feel free to check out the test site page here: hidden link

You can switch languages with the footer language switcher to test it out. I tried keeping your custom theme active and activating only WPML and WooCommerce to further test, but this caused a fatal error due to your custom code in your theme's functions.php file. Due to the extent of custom code, at this point I need to suggest you consider contacting one of our certified partners from this link: http://wpml.org/documentation/support/wpml-contractors/

I'm sorry I am unable to provide a custom solution for you, but I hope one of our contractors will be able to sort through the custom code and get this resolved for you.

January 29, 2020 at 6:46 pm #5386953

a.m.L

Hello, the link that you have provided does not contain anywhere output links to taxonomy brand Porsche. I did the same, only additionally created a test page with a link to a taxonomy that has an error. As a result, the error remains even when installing the standard Twenty Nineteen theme. This means that the problem is not in custom code. You can verify this by creating a test page and calling a taxonomy.
For example:
<?php

/*
Template name: Test issue
*/

$link = get_term_link(1844, 'merk');
print_r($link);

?>

photo_2020-01-29_20-44-10.jpg
January 31, 2020 at 3:51 pm #5401139

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I created that template and assigned it to the following page: hidden link

I tried to reproduce the issue in the original post where if you set the taxonomy to not translatable, the terms displayed. However, after changing that setting, I still saw the error. So, I disabled WPML and still see the error.

Can you please help me to reproduce the issue on this test site so that I can show our developers the issue that occurs only when the taxonomy is set to Translatable? In other words, can you show me how the code you are using DOES show the terms with the correct settings? I will be able to escalate to our developers once I can see that happening again. Thanks!

February 3, 2020 at 9:23 am #5410385
a.m.L

Hello,
I am getting this error for particular
hidden link
Please look on that .
find the screenshot

New threads created by Lauren and linked to this one are listed below:

https://wpml.org/forums/topic/error-with-different-domains-per-language/

Capturess.PNG
Capture.PNG
February 3, 2020 at 6:23 pm #5415033

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

The error you are seeing is a separate issue from what this ticket was originally opened for, so I have split the ticket and will address that issue in a new one. Please see my previous reply and let me know how I can reproduce the original issue when the taxonomy is set as translated. Thanks!

February 4, 2020 at 3:35 pm #5422711

a.m.L

We have already gone through this, I answered all these questions. The essence of the problem was clearly described and in the last message it was vividly demonstrated, no matter what topic was set. You named the ticket as - get_terms is not working correctly, which in general has nothing to do with the problem that I described to you. I had no questions about the get_terms function.

February 4, 2020 at 3:38 pm #5422721

a.m.L

Do not pay attention to the message from FEBRUARY 3, 2020 AT 9:23 AM, this was mistakenly written by another developer.