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 5 replies, has 2 voices.

Last updated by daniel 3 months, 3 weeks ago.

Assigned support staff: Yvette.

Author Posts
May 22, 2020 at 4:46 pm #6197231

daniel

I am trying to: add the Links to translation of posts options on my site

Link to a page where the issue can be seen: hidden link

The link appears on the home page, and unfortunatly adding:

add_filter( 'icl_post_alternative_languages', 'custom_post_alternative_languages' );
function custom_post_alternative_languages($out) {
if( is_single() ) {
return $out;
}

return;
}

doesn't help 🙁

the homepage uses elementor... Any idea ?
thanks in advance

May 24, 2020 at 4:00 pm #6204773

Yvette
Supporter

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

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

Hello

Where are you trying to display this link? Where is the link? It is not evident on your homepage. Could you please annotate your screenshot or describe in detail where I should look on the page?

And also the behaviour you expect that should happen when I select the link.

Thanks.

May 24, 2020 at 4:05 pm #6204821

daniel

Hello, thanks for your message but Yeah I disabled it now because of the problem as you could guess,
When it is enable, the Link is showing ok on posts and everywhere where it should, but it is also showing as I already said in the home page where it shouldn't , did you look at the screen shot to see the problem ??

and one more time like I said adding this snippets that I found on this forum doesn't help.

add_filter( 'icl_post_alternative_languages', 'custom_post_alternative_languages' );
function custom_post_alternative_languages($out) {
if( is_single() ) {
return $out;
}

return;
}

Seriously why I always have to repeat twice my problem to have a good assistance on this forum ??? 🙁 🙁 !!

thanks for your help ...

May 24, 2020 at 4:49 pm #6204937

Yvette
Supporter

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

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

Hmmm. Maybe you should consider that *you* might need to be more clear if you are always having to repeat yourself . Just a thought - it takes two to communicate well.

For example, you could have included the text I should focus on - or where on the screenshot that I might find this text. A big red box would be best with a big arrow pointing to the text. I had to hunt for at least 3 minutes searching that picture to finally see that its in the upper left hand corner with the text "C'est post est aussi disponible en." in small letters. And now I understand more of what your problem is about.

A small effort on your side makes it much easier for us to help you. A kind and polite tone also does wonders but it is not as necessary as clear and precise descriptions of problems.

Now, for the snippet. It´s probably an old ticket since we have not been adding code to the forum for several years now given the issue of being expected to provide updated versions of quick fixes. The code is evidently hooking on an action that is also happening on the homepage. You could consider adding a logical condition to your existing code to check that the active page is not equal to the homepage in order to execute.

If you wish to rewrite the snippet with these filters, setup an example that we can evaluate - then we´re happy to help you get it right but we are not permitted to write any code.
Here is the list of our available hooks/filters:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

Take a close look at:
https://wpml.org/wpml-hook/wpml_get_element_translations/
Note that it will require you to know the "trid" which you get from here
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-1215366

Otherwise, your request falls outside the scope of our support policy (see image) and I need to refer you to a WPML Contractor
https://wpml.org/contractors/

https://wpml.org/purchase/support-policy/

Have a nice evening.

May 24, 2020 at 6:06 pm #6205227

daniel

Well thank you for your long answer and sorry if I the screenshot wasn't clear enough... I thought the problem was often happening as I found lot of posts with that... didn't think it was so complicated to figure it out.
But I don't understand something!
This wplm option is not working well on my website, I already searched how to solve the problem alone but it didn't work..
And now you tell me you can't help and I should loose my time digging more into I don't know which hook, and write myself the solution to solve it ?
Well thanks very much for the support haha !

May 24, 2020 at 8:48 pm #6205713

daniel

It took me 2h to find a way to solve my problem. so I pay suppor for telling me to do the support. merci et bravo 🙁 🙁