The WPML is not selectable as a menu for the header of Pro

I have created an empty menu called Translation:

I have selected that menu in WPML:

However that menu does not appear when I tried to add it to the header:

Why?

Thanks for your help :slight_smile:

Carlos

Hi there,

Thanks for writing in.

Would you mind providing your site’s URL and admin login credentials in a secure note? And for the meantime, please install a Transient Cleaner plugin and clean it, it could be due to transients (internal cache).

Thanks!

I have installed the Transient Cleaner plugin: https://es.wordpress.org/plugins/artiss-transient-cleaner/

Below, you can find the credentials to enter to edinventa.com/wp-admin

Thank you :slight_smile:

Carlos

Hi there,

Unfortunately, the login is incorrect. I tried multiple combinations and not working. Please provide the correct login.

Thanks!

hmm I have created a new one

Hi There,

Thank you for the credentials.
Yes, I can see the issue. For the menu to be available on header/footer builder navigation element dropdown, there should be at least 1 menu link and not empty. Only those menu with content will display. WPML parse the menu differently.

Hope this helps.

So, how can I solve the issue? I mean, I want to add an inline menu with ONLY THE FLAGS on the left of the drop down menu. Any idea of how to achieve this? :confused:

You may want to explore using the language switcher shortcode: [wpml_language_switcher]

You could place it in a Content Area element so it outputs directly in the container, or you could use a Content Area Dropdown element if you’d like the user to click something before it’s revealed.

You can learn more about the parameters available here:

I have added the shortcode: [wpml_language_selector_widget]

It’s working for desktop. Unfortunately it’s not working for mobile well:

Is it possible to use a dropdown menu in mobile and and a horizontal list in desktop? Any other idea? :confused:

Thanks for your attempt

Carlos

Hi Carlos,

You can try reducing the size of your image to give some room to your language selector.

You can add this in Header > CSS

@media(max-width:480) {
.hm3.x-image {
    width: 120px;
}
.wpml-ls-legacy-list-horizontal a {
   padding:5px;
}
}

Hope that helps.

It does not seem to change anything :confused:

I think I have added the code where you are meaning. Is it? Please see below a screenshot:

By the way, the preview of Pro shows the flags well, but not my smartphone:

When inspecting any element you can go to the “Customize” tab. From there you can toggle visibility at different screen sizes. You can add a regular content area element and place the shortcode inside it, then set that to appear on Desktop. Then you can add a Content Area Dropdown element with the shortcode inside it and set that to appear on mobile.

EDIT: I’m sorry, I accidentally saved over this, but put the message back as best I could. I thought I was adding the reply below and I was actually editing this post

It could be a good idea… Unfortunately it seems Themeco Pro has a bug? I have not been able to add the WPML menu to the header because it seems Pro does not show the WPML menu as selectable because it sees it “empty”. Actually that’s the original issue I’m trying to solve when I open this ticket (please read previous messages).

Any workaround to be able to fix this bug meanwhile? Any other solution? :confused:

I understand. It’s not a problem in Pro, but rather that WordPress doesn’t allow a menu to be output directly if it has zero items. WPML adds an item dynamically, but WordPress only considers real menu items.

I did some testing and found that it does work for some reason if the menu is assigned to a location. Try adding this code to functions.php of a child theme:

register_nav_menus( array( 'language_switcher' => 'Language Switcher' ) );

Then assign your empty menu to that new location. In Pro, the location should be selectable from a menu element.

It may still be a better option to use WPML’s official shortcode instead of an empty menu. You will likely run into the same issue with how it doesn’t appear correctly on smaller screens.

Awesome! That works! I’m trying to make the logo a little bit smaller on mobile and the padding of the flags also smaller, but the code you workmate gave me does not seem to work well (or I’m doing something wrong!). This is how it looks thanks to your solution :slight_smile:

So I want either reduce padding of the flags (I have to find the way to reduce them anyway as it’s bigger than the header bar) or reduce the logo width. Or BOTH! :smiley:

This is the code your workmate gave me and the place where I’m inserting it (notice I have modify the width to 20px to see better if it’s actually working):

Thank uuuuu :smiley:

Try adding this CSS

@media (max-width:390px) {
    .e1225-5.x-menu > li > .x-anchor .x-anchor-content {
        padding: 0 !important;
    }
    .e1225-3.x-image {
        width: 80%
    }
}

Hope that helps.

It’s working beautifully. I just wanted to share with you the solution proposed by the WPML support team. Their solution is basically selecting as a primary menu the translation menu. I did not tested with Themeco Pro, but I let you know for your reference: https://wpml.org/forums/topic/the-wpml-is-not-selectable-as-a-menu-for-the-header-of-my-theme/#post-1547806

I appreciate your help a lot! :slight_smile:

Carlos

You’re most welcome and thanks for sharing :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.