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 13 replies, has 3 voices.

Last updated by sarah.n 7 years ago.

Assigned support staff: sarah.n.

Author Posts
August 14, 2013 at 9:25 pm #154882

daniel

Hello, i don't know how to reopen a ticket so i do one new..
Some time ago i was triing to get the english slug of a taxonomy on the french translated page..
we had this thread : http://wpml.org/forums/topic/same-slug/

but i had other problems and i didn't have time to check that so it's closed...

So ! now i'm back on this and the method you gave me is working ok on the home page but if you go into categories than it doesn't work anymore... 🙁

have a look here :

hidden link

on each item you have french ID an slug and then English ID and Slug...
so on the home page it's ok : joyeux and feel good ! great !

but then go on a category :
hidden link

and the english slug is joyeux like the french one 🙁 🙁

i have this :

function set_icl_adjust_id_url_filter_off($off){
global $icl_adjust_id_url_filter_off;
$icl_adjust_id_url_filter_off = true;

}
add_action('init','set_icl_adjust_id_url_filter_off');

in my function.php

why is it working only for the homepage ??

thanks for your help...

August 15, 2013 at 6:41 am #154914

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

Lets see what we can do here..
I have a feeling that in the end we need to involve also the theme author to make (and keep) the theme WPML compatible.

1) Which WPML versions are you currently using?
(there is a handy listing under "WPML > Support")

2) To be sure is the theme in question this one?
hidden link

--
http://wpml.org/forums/topic/same-slug/#post-142717

August 15, 2013 at 7:42 am #154932

daniel

Hello, thanks for your answer, yes it is modernize, but i did the test on this other site because i had the problem for my Sommerce theme site here :

hidden link

which is Sommerce and is wpml "compatible"...

so on the page you can see it's ok the slug are the good one , but go in any category and the English slug will return the French one...

Any idea ?

thx

August 15, 2013 at 10:01 am #154993

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

I see - true, the very same problem there as well.
Could you post the complete PHP file where you added the "slugEN:" / "slugFR:" on pastebin.com for me to see?
Thanks!

August 15, 2013 at 10:25 am #155001

daniel

my file is a little big i put you just the useful function for this

here it is

http://pastebin.com/v35ZLUY0

i tried with and without what sarah told me also, but it didn't changes...

global $sitepress;
remove_filter('get_term', array($sitepress,'get_term_adjust_id'));
$slugEN= get_term_by('id',$idEN, 'pa_instruments');
add_filter('get_term', array($sitepress,'get_term_adjust_id'));

August 16, 2013 at 9:40 am #155226

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

Thanks - thats quite helpful, don't worry we are used to long files 🙂

Looking agian at hidden link
please forgive me should have asked earlier, why exactly do you need the slugs there?

August 16, 2013 at 9:43 am #155227

daniel

Hello, i don't need it on studiolebus (it was for testing on another environment) but on musicincloud.com
because i show image of instruments based on the slug of the english product attributes...
if the translated page loads the image based on the translated slug it won't work !

i can upload image for each slug of each language but.... you see what i mean ? 🙂

August 19, 2013 at 11:20 am #155712

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

Sorry for the delay! I understand, you need it to form links to image resources.

The translated slug is saved in one of your database tables.
I think it should be possible to get it from there via our API function "icl_t".

Could you provide us with credentials for your website and we have a closer look?
I will sent you an email with more details in a minute. Thanks in advance!

August 22, 2013 at 12:35 pm #156835

daniel

Hello, any news about this ? thx

August 23, 2013 at 12:34 pm #157164

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

I'm very sorry, but I'm still checking the issue and it will take some more time.

August 23, 2013 at 12:37 pm #157166

daniel

Thanks for your message... waiting to have some news..

August 26, 2013 at 11:05 am #157609

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

Hello Daniel,

This is Sarah here.

Please check now: hidden link

The problem was that we were trying to remove a filter that had not been added yet.

It seems to work with this adjusted code:

global $sitepress;
remove_filter('get_term', array($sitepress,'get_term_adjust_id'),1);
$slugEN= get_term_by('id',$idEN, 'pa_instruments');		
add_filter('get_term', array($sitepress,'get_term_adjust_id'),1);
August 26, 2013 at 11:12 am #157612

daniel

GREAAT thanks a lot it's working perfectly now 😉 all images are loaded correctly with the good english slug based file..
Thanks again

best regards

August 26, 2013 at 11:21 am #157616

sarah.n
Supporter

Languages: English (English ) German (Deutsch )

You are welcome 🙂