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

Last updated by Marcos Vinicios Barreto 9 months, 2 weeks ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
February 11, 2021 at 1:07 am #8056647

pabloS-24

try adding the language selector in the main menu and the page shows the html tag added by the plugin, do you know how I can fix it?

span.png
February 11, 2021 at 2:28 am #8056889

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for contacting our support service. It happens due the way your theme code outputs the menu items, so, it is most likely related to a compatibility issue between your theme and WPML. In these cases, these are the procedures:

  • Install the theme/plugin in a clean installation and reproduce the problem in this new installation. So we can isolate it and do some testing without the interference of server settings or other plugins
  • After this, I will check the problem in this new installation and look for a quick solution
    If I can not find a solution, I will forward the problem to our compatibility team.
  • The compatibility team will do some more testing and will contact the product author to fix the issue

I created a test website with a clean WordPress install. You can access it through this link:
hidden link - Through this link you will be automatically logged in.

Please upload the (theme/plugin) to this test install, setup it the same way as in your website (using the same options) and create some dummy content to reproduce the issue. Please note that we only need the (theme/plugin) and the related functionality, you don't need to setup a entire website or clone your existing site. The fewer plugins the better.

After that, please send us clear steps on how to see/reproduce the issue on this test install. We will run some tests.

Please, let me know when you are ready, thank you for your collaboration, have a nice day.

February 11, 2021 at 11:50 pm #8065759

pabloS-24

Thanks, I already loaded the template of my page on the test website and did the WPML configuration, apparently the error continues in the menu

MenuConfi.png
menuHeader.png
configMenu.png
February 12, 2021 at 2:31 pm #8071873

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates. It is a confirmed compatibility issue which I have forwarded to our compatibility team, I will update you here as soon as I have some more details regarding it.

Thank you for your continued patience and understanding, have a nice day.

February 18, 2021 at 5:31 pm #8121649

pabloS-24

Thank you I would like to know about the status of my issue.

February 19, 2021 at 2:01 am #8123527

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates and sorry for the bit of waiting here. Our compatibility team recommends the following workaround:

IMPORTANT: Please, note, a backup is required for security reasons and to avoid any data loss, you can use the https://wordpress.org/plugins/backupwordpress/ plugin for these backup needs.

1 - Click to edit the functions.php file from your theme folder.

2 - Find the line 406 where it reads:

if ($i < $menu_count - 1 && $menu_items[$i + 1]->menu_item_parent == $menu_item->ID) { ?>

Change it to:

if ($i < $menu_count - 1 && $menu_items[$i + 1]->menu_item_parent == $menu_item->ID && ! is_a($menu_item, 'WPML_LS_Menu_Item')) { ?>

3 - Find the line 447 where it reads:

<li><a href="<?php echo esc_url($menu_item->url) ?>"><?php echo esc_html($menu_item->title) ?></a></li>

Change it to:

<?php if (is_a($menu_item, 'WPML_LS_Menu_Item')): ?>
                        <li><a href="<?php echo esc_url($menu_item->url) ?>"><?php echo esc_html($menu_item->attr_title) ?></a></li>
                        <?php else: ?>
                        <li><a href="<?php echo esc_url($menu_item->url) ?>"><?php echo esc_html($menu_item->title) ?></a></li>
                        <?php endif ?>

Note: This workaround won't enable you to use a dropdown selector, for that you would need to contact your theme author for a more detailed solution.

Hope it helps, have a nice day.

February 22, 2021 at 5:58 pm #8147781

pabloS-24

Hello, I made the indicated changes and apparently I have the same problem when trying to add a list to the menu.

page.png
list.png
February 23, 2021 at 11:32 pm #8158189

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates. I tested the provided code again at my localhost and everything works fine, please, make sure you have added the code to the functions.php file of your theme, following my instructions carefully. If the issue persists, please, provide me with some access to your WordPress Dashboard and I will check it myself. For that, please, consider:

I would like to request temporary access (wp-admin and FTP) to your site to take 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 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

Please, let me know if you need any additional details. Have a nice day.

February 26, 2021 at 2:56 am #8177555

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates. I checked your website and confirmed the issue, I noticed you are running a menu management plugin (Max Mega Menu) which could be interfering in the menu output.

If you want to keep this plugin, I recommend you to contact your theme author for guidance on how to proceed, as in our tests the provided code works when you don't have a third party interfering in the menu output.

Hope it helps, have a nice day.