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

Last updated by Lauren 1 year ago.

Assigned support staff: Lauren.

Author Posts
October 11, 2018 at 6:18 pm #2809449

leonV-12

I'm trying to get the flags in the upper right corner, right before the search icon) with the following action

do_action('wpml_add_language_selector');

however if i place it in a header (child theme), it messes up the whole layout

please support, i can provide ftp/wp-admin credentials

October 12, 2018 at 7:21 pm #2812957

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.

It sounds like whereever you are placing in in your header might be breaking the layout. Please check to see if you are placing it outside of a div, or in the middle of a div.

Also, can you please share a link to your site so I can see where this is happening?

To ensure the quickest and most accurate support, please provide your debug information so that I can get a look at some of your configurations. We have an excellent article on how to located here: https://wpml.org/faq/provide-debug-information-faster-support/.

NOTE: Please be sure to check the box to indicate you can provide debug info and paste your debug info in the debug field provided, and NOT in the general response field.

October 15, 2018 at 12:26 pm #2817384

leonV-12

it's kind of getting at the wrong place now if i add the

<?php do_action('wpml_add_language_selector'); ?>

to
header-v1.php

so it's not breaking the site now actually.

from the avada theme.

October 15, 2018 at 1:43 pm #2817795

Lauren
Supporter

Languages: English (English )

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

I'm not sure if I understand your last response. You said that it is no longer breaking the site. Do you still need further assistance? If there is still a problem, please explain what is happening and share a link to your site so I can see the issue. Thanks!

To ensure the quickest and most accurate support, please provide your debug information so that I can get a look at some of your configurations. We have an excellent article on how to located here: https://wpml.org/faq/provide-debug-information-faster-support/.

NOTE: Please be sure to check the box to indicate you can provide debug info and paste your debug info in the debug field provided, and NOT in the general response field.

October 16, 2018 at 12:49 pm #2820988

leonV-12

unfortunately i do, I just want the flags to be next to the magnifying glass (search)

I cannot do it out of the options from the plugin, so I'll need to do it in the PHP files

I noticed the topbar is header-v1.php but wherever I place this code, it gets either under or above the logo.

you have a solution for this? I can provide login details if neccesary. (lre-solutions.com)

October 16, 2018 at 3:23 pm #2821537

Lauren
Supporter

Languages: English (English )

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

Thanks for the additional information. When I look at your site, it looks like you have now added the language switcher to the menu, which is why is floating to the left. You can try adding custom css to the wpml menu items (you can right click and inspect the page to test this, as per my screenshot).

If you prefer to remove it from the menu and use the php that you mentioned above, you can wrap that in a <div> tag and then use CSS to float it to the right.

October 16, 2018 at 10:27 pm #2822490

leonV-12

hi lauren, it works, however the issue is that if I press the English flag, everything is fine, but if i press the Dutch flags, the whole layout messes up as you can see in the screenshot.

css is in the screenshot.

October 17, 2018 at 3:42 pm #2825219

Lauren
Supporter

Languages: English (English )

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

Which browser are you using? I just checked your site in both languages and the language switcher and menu look correct. Please try clearing your browser cache and let me know if you are still seeing what you sent in the screenshot.