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:
The client is using the Nanosoft theme and, when clicked, the logo on the secondary language sends to the default language instead of sending to the same secondary (current) language.

Solution:
So it seems that the issue is produced by the theme.

If you go to "wp-content/themes/nanosoft/tmpl/header.php" - on line 43, you will find this piece of code:

<a href="<?php echo esc_attr( site_url() ) ?>">

"site_url" is not filtered by WPML and is always in the default language, so as mentioned in the documentation links below, you should replace "site_url" into "home_url".

So the new code should look like this:

<a href="<?php echo esc_attr( home_url() ) ?>">

Documentation:
- https://wpml.org/it/wpml-hook/wpml_home_url/
- https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/home-page-link/

This topic contains 6 replies, has 2 voices.

Last updated by victorC 5 months ago.

Assigned support staff: Mihai Apetrei.

Author Posts
May 15, 2019 at 3:54 pm #3818555

victorC

I am trying to:
the logo on the portuguese side links to the spanish home page when it should llink to the portuguese home page
Link to a page where the issue can be seen:
hidden link
I expected to see:

Instead, I got:

May 15, 2019 at 5:56 pm #3819263

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for contacting WPML Support!

I will be happy to help you with this.

1. Can you please let me know how is that logo implemented? Unfortunately, I was not able to find the theme as being part of our official WPML-compatible themes directory here (https://wpml.org/documentation/theme-compatibility/) so we might be dealing with a compatibility issue.

2. a. Can you please let me know if you tried to go to WPML > String Translation and search for any of the words in those sentences?

Here is some very helpful documentation on how to use the String Translation plugin:
https://wpml.org/documentation/getting-started-guide/string-translation/

If it's not there, it could help if you scan the plugin/theme that's generating the strings and then go back to WPML > String Translation and see if the strings show up:
https://wpml.org/documentation/getting-started-guide/theme-localization/

b. If you can't find it inside the WPML > String Translation, it might be added as admin text.

This should be the normal process to translate admin texts:
https://wpml.org/documentation/getting-started-guide/translating-theme-options/

3. If you still can't find it, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of the site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this: hidden link

Also, can you please paste your WPML Debug information in the Debug information field?
http://wpml.org/faq/provide-debug-information-faster-support/

I will be waiting for your response.

Kind regards,
Mihai Apetrei

May 15, 2019 at 6:43 pm #3819627

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

1. You are right, I have already seen that the developers say the theme is compatible and it might be 100% or partially compatible, but when a theme shows up in our official repository, that means that someone from our team tested that theme/plugin already and it works.

That's why we have programs like the 'Go Global' program (https://wpml.org/documentation/theme-compatibility/go-global-program/) where our Compatibility developers help developers make their plugin/theme 100% compatible with WPML for free.

Until we don't run a few debugging processes and until we don't have JUST the theme and the WPML plugins on a clean install on our servers to see if the issue is repeating on our servers too, we can't know for sure.

2. Regarding this topic, the String Translation plugin doesn't mean that it will translate only strings like "word" but many times it can include for example strings from the theme admin screens (like the logo link) that would look like this: "<a href="link-of-the-site"><img src="link-of-the-logo"/></a>" and you could "translate" them for another language and change the link inside the "href" attribute for example.

That is why I sent you those steps and the documentation.

Here are a few ticket examples:

- https://wpml.org/forums/topic/translation-of-logo-image/
- https://wpml.org/forums/topic/translate-logo-image/#post-1424601 (media attachment: hidden link)
- https://wpml.org/forums/topic/translate-logo-based-on-language/

3. Thank you for the credentials. I am at the end of my shift at the moment but I will be able to look more into this tomorrow.

I will leave the ticket assigned to myself at the moment and will get back to you tomorrow.

Kind regards,
Mihai

May 15, 2019 at 7:11 pm #3819801

victorC

Hi Mihai,

I tried your link but I cant make it work, so i will wait for your imput tomorrow

Thanks

May 16, 2019 at 5:24 pm #3828349

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi.

So it seems that the issue is produced by the theme that you are using.

If you go to "wp-content/themes/nanosoft/tmpl/header.php" - on line 43, you will find this piece of code:

<a href="<?php echo esc_attr( site_url() ) ?>">

"site_url" is not filtered by WPML and is always in the default language, so as mentioned in the documentation links below, you should replace "site_url" into "home_url".

So the new code should look like this:

<a href="<?php echo esc_attr( home_url() ) ?>">

Documentation:
- https://wpml.org/it/wpml-hook/wpml_home_url/
- https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/home-page-link/

I tested it and that solves the issue.

Kind regards,
Mihai

May 16, 2019 at 5:32 pm #3828397

victorC

Hey Man, you are a rock star !!! thank you very much !!!!
I really appreciate your help, yes I was near but because I gave you access I didnt want to mess with code, I am glad that you solved the problem.

Regards

May 16, 2019 at 5:33 pm #3828403

victorC

My issue is resolved now. Thank you!