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: How can I correctly redirect the menu for anchor links?

Solution: Please go to Appearance -> Menus and click on the pencil icon to display the translated menu. When you open the menu item to display the link, make sure it has the full url and not just the anchor part

This topic contains 1 reply, has 2 voices.

Last updated by Lauren 1 year, 5 months ago.

Assigned support staff: Lauren.

Author Posts
May 9, 2018 at 2:47 pm #2055102

f.d

I've translated my menu items. These link to anchors in my page so I used string translation and synced menu items. Now the class of all translated menu items are set to 'current-menu-item'. If you click on such a link it does not open the target page.

<li id="menu-item-5549" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item"><a href="mysiteurl/en/slug/#anchor" itemprop="url"><span class="avia-bullet"></span><span class="avia-menu-text">Linkname</span></a></li>
May 10, 2018 at 3:14 pm #2075487

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

Please go to Appearance -> Menus and click on the pencil icon to display the translated menu. When you open the menu item to display the link, does it show the full url or just the anchor part? Please try adding the full translated URL along with the anchor and let me know if this resolves the issue.