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.

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Nigel 1 year, 8 months ago.

Assisted by: Nigel.

Author Posts
July 24, 2023 at 11:28 am #14088969

thomasP-18

Tell us what you are trying to do?
I try to change the link on the logo in French and English language version to the
French and English homepage.

I use hidden link to create the main menu.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
No

What is the link to your site?
hidden link

July 24, 2023 at 2:44 pm #14090609

Nigel
Supporter

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

Hi there

I can see the issue on your site, and the logo on the secondary languages is linking not even to the current DE homepage but to what looks like it might have been a staging server.

In any case, have you tried to scan and update link targets?

Go to WPML > Settings > Translate Link Targets and try the scan to fix any problem links.

Screenshot 2023-07-24 at 15.43.21.png
July 24, 2023 at 4:52 pm #14091575

thomasP-18

Hi,
I scannet the links.

But I am not sure what I have do do after this.

In the translation page of the header the link do not appear.

Can you give me some additional information what to do after scanning?

Many thanks!

July 25, 2023 at 11:20 am #14095829

Nigel
Supporter

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

I can see the links haven't changed on the site.

Would it be possible to access the site to see how it is set up?

I'm not sure if the logo in the header is added by your theme (which I don't recognise) or your page builder.

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site. (If you have a staging site that would be preferable.)

July 25, 2023 at 2:02 pm #14097103

Nigel
Supporter

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

Sorry, but could you give me some direction about how this is put together?

I can't tell how the logo is added to the header. Inspecting the markup generated it looks like it comes from Quad Menu, but I can't tell where in the UI Quad Menu handles adding the logo and links. (We have WordPress menus, JetMenus, QuadMenus...)

July 25, 2023 at 2:18 pm #14097201

thomasP-18

Hello again,

it is part of the Quad menu.

hidden link

The name of them menu is: Tachofresh blue

Link and logo you see in the screenshot: Bildschirmfoto 2023-07-25 um 16.16.06.png

Bildschirmfoto 2023-07-25 um 16.17.25.png
Bildschirmfoto 2023-07-25 um 16.16.06.png
Bildschirmfoto 2023-07-25 um 16.15.42.png
July 25, 2023 at 3:54 pm #14097901

Nigel
Supporter

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

Would it be okay to take a copy of the site to install locally for testing? I need to try and see where the URL is stored and how it is output to whether it is feasible that the URL can be modified by WPML on secondary languages, and that will be easier if I'm not working on your production site.

July 25, 2023 at 9:25 pm #14098919

thomasP-18

Yes sure, you can do this …

Many thanks for your effort !

July 26, 2023 at 10:21 am #14102311

Nigel
Supporter

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

Thanks.

Having examined the plugin code I can see that it makes no allowance for a multilingual setup (whether you were using WPML or something else), so the first thing I would do is to suggest you contact the plugin authors and invite them to join our compatibility programme so that we can work with them about making their plugin multilingual compatible. You can share this link with them: https://wpml.org/documentation/support/go-global-program/

I looked through some of their plugin source code to see if I could spot a filter that could be used as a workaround to modify the URL, but couldn't.

Which means the only solution I could find was to modify their plugin code itself. I'll share details below, but note that this means that every time you update the plugin the changes would be overwritten and you would need to re-apply them, hence why it is a good idea to encourage them to make their plugin multilingual ready.

The changes suggested below relate specifically to your use case, which is that the logo should link to the home page (in the current language). If at any time you changed the link to point somewhere other than the home page then it would need modifying.

Replace the current content of the file plugins/quadmenu/templates/logo.php with

<?php if ($url):

  $home = get_option('home');

  if ( $link == $home ) {
    $link = apply_filters( 'wpml_home_url', $home );
  } 

?>
  <a class="quadmenu-navbar-brand img" href="<?php echo esc_url($link); ?>"><?php printf('<img height="60" width="160" src="%1$s" alt="%2$s"/>', esc_url($url), esc_attr(get_bloginfo('name'))); ?></a>
<?php endif; ?>

(Note that we cannot provide support for custom code; I tested this on my local copy of your site, where it worked, but if you encounter problems with it you should contact quadmenu or a WordPress developer for further help.)

July 26, 2023 at 11:20 am #14102957

thomasP-18

Hello,

thank you for this answer.

Do you think I can place different menus in the header for each language.

This is what Quadmenu suggested to me.

But I don't know how to do that. When I open the header in Elementor, the German version always opens.

July 26, 2023 at 2:17 pm #14104695

Nigel
Supporter

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

You can create different versions of Elementor templates to use on different languages (rather than simply translate templates to different languages) and I guess you could do the same with Elementor header templates.

See this document for how to do that: https://wpml.org/documentation/plugins-compatibility/elementor/#creating-different-elementor-templates-per-language