Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client reported that the WPML language switcher was not correctly positioned in the middle of the menu, and hovering over the flags displayed code instead of the expected behavior. Despite deactivating all third-party plugins one by one, the issue persisted.
Solution:
We suggested a workaround involving a code modification. The client needed to open the

.../wp-content/themes/thecappa/framework/wp_bootstrap_navwalker_2.php

file, locate line 83, and replace:

$atts['title']  = ! empty( $item->title ) ? $item->title : '';

with:

$atts['title']  = ! empty( $item->title ) ? trim(strip_tags($item->title)) : '';

This change might also be necessary in the

wp_bootstrap_navwalker.php

and

wp_bootstrap_navwalker_3.php

files. Additionally, we recommended contacting the theme author to join our Go-Global program to ensure full compatibility with WPML.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance at WPML support forum.

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 Kor 1 year, 8 months ago.

Assisted by: Kor.

Author Posts
August 13, 2024 at 11:54 pm #16068337

austinN

Hi

Switcher not in the middle of menu, drop down flag and country name is Press enter and hover to flags it show code like a picture i attachment.

16064169-Screenshot_2024_08_13_085425.png
16064169-z5725645914190_018fe6ed54a401c79e3256183a8a4b3c.jpg
August 14, 2024 at 9:09 am #16069414

Kor

Hello,

Thank you for getting in touch. It appears that a third-party plugin might be causing issues with the WPML language switcher.

Please make sure to back up your site, then deactivate your third-party plugins one by one to identify which one is causing the problem. Let me know the outcome.

August 15, 2024 at 2:36 am #16072900

austinN

Hi Kor

Thank you for your assistance.

I appreciate you suggesting the plugin deactivation approach. Unfortunately, I've already tried deactivating all third-party plugins one by one, but the issue persists.

To expedite the troubleshooting process, would it be possible for you to access my WordPress account to investigate the problem further? I can provide you with temporary login credentials. Alternatively, if you could suggest other potential solutions or steps I can take, I'd be happy to try them.

Thank you for your understanding and support.

Best regards,
Austin

August 15, 2024 at 7:07 am #16073111

Kor

Thanks for your reply.

I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

August 20, 2024 at 1:37 am #16085540

austinN

Hi Kor,

Just wanted to confirm that I've already installed my theme on the sandbox site you provided: hidden link

And you can replicate it.

Thanks again,
Austin

August 20, 2024 at 4:59 pm #16087915

Kor

Thanks for your reply.

I can replicate the issue here hidden link and I've escalated this to our 2nd Tier Support for further investigation. I will come back to you once I've feedback.

August 24, 2024 at 2:59 am #16099806

austinN

Hi Kor,

I hope this email finds you well.

I'm following up on the issues we discussed previously. Could you please provide an update on its status?

Thank you for your time and attention to this matter.

Best regards,

Austin Ng

August 26, 2024 at 8:35 am #16103123

Kor

Thanks for your reply.

Sorry, no updates yet but our 2nd Tier Support is already looking into this for you.

August 27, 2024 at 2:53 pm #16110726

Kor

Thanks for your patience.

We have a workaround to fix this.

Open .../wp-content/themes/thecappa/framework/wp_bootstrap_navwalker_2.php file.

Look for line 83.

Replace:

$atts['title']  = ! empty( $item->title )	? $item->title	: '';

With:

$atts['title']  = ! empty( $item->title )	? trim(strip_tags($item->title))	: '';

Please note that this change may be need to be done as well in wp_bootstrap_navwalker.php and wp_bootstrap_navwalker_3.php files.

Also, please contact the author and/or ask him to join our Go-Global program here https://wpml.org/documentation/support/go-global-program/ where our Compatibility developers will help them make their product 100% compatible with WPML for free.

August 28, 2024 at 2:40 pm #16115864
austinN

Hi Kor

Thank you for your sp. I already change code and it fixed for the issue"hover to flags it show code like a picture i attachment." But "Switcher not in the middle of menu and when i drop down to choose another lang, The flag and the country name are not aligned "

Best,

Austin

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

https://wpml.org/forums/topic/the-flag-and-the-country-name-are-not-aligned/

Screenshot 2024-08-28 213228.png
August 28, 2024 at 2:59 pm #16115953

Kor

Thanks for your reply and I'm glad that helped.

Our support policy allows us to take care of only one issue per ticket.

Continuing with one issue per ticket helps not only supporters to focus on one issue at once, but also enables other users to find solutions to their questions faster.

So, I've split the ticket here https://wpml.org/forums/topic/the-flag-and-the-country-name-are-not-aligned/ so that we could follow up regarding the language switcher flag alignment issue.

As for this ticket, please mark it as resolved.