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 basv-25 2 months, 4 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
July 17, 2019 at 7:50 am

basv-25

Hi There, I would like the currency switcher to be placed next to the language switcher in my secondary menu. Can you help me with this? I've created a staging area for you to play in.

July 17, 2019 at 7:55 am
July 17, 2019 at 10:42 am #4228775

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there,

Welcome to the forum, I will help you with the issue.

You can use the below code to your child theme functions.php file to display the currency switcher next to language switcher

function add_last_nav_item($items,$args) {
   if( $args->menu->name == 'Preferences Menu' ) { // Menu name in which language switcher is added
   $items .= '<li class="wcml-crrency-switcher-cs">'.do_shortcode('[currency_switcher]').'</li>';
  }
 return $items;
}
add_filter('wp_nav_menu_items','add_last_nav_item',10,2);

You might need to add some CSS to unhide the currency switcher

 .wcml-crrency-switcher-cs > ul {
   position:relative !important; 
   top:0 !important
}

I hope this helps you better.

Kind regards
Raja

July 17, 2019 at 11:02 am #4229007

basv-25

Hi Raja, thank you for your prompt reply. I have added your code to the functions.php and the css to the Salient csuotm CSS code box. See printscreens attached. There are things happening in my secondary menu because the language swithcer moved to the left. But I can't see the currency switcher yet. Can you help me? Thanks!

July 18, 2019 at 5:38 am #4235101

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have made some adjustments in the custom CSS to display the currency switcher, Please proceeding with further adjustments to make it look good for your site.

The theme style is conflicting with the applied style and hence you see a distorted currency switcher. However, This is a custom work and goes beyond our scope of support,
Please let me know if there is anything else I can help with our plugins.

Thanks for your understanding.

kind regards
Raja

July 22, 2019 at 7:36 am #4254459

basv-25

Hi Raja,
Thank you for the changes. At the moment I'm styling the switcher with some help from Salient.

July 22, 2019 at 12:32 pm #4257183

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I hope you can resolve the style issue with the theme support, Since the issue related to the forum is already solved, I would request mark the thread as resolved, If you have any related issue please open a new ticket.

Kind regards
Raja

July 22, 2019 at 12:38 pm #4257261

basv-25

Hi Raja, perfect thanks. Little question, do you know if it is possible to add something in the custom css field to customize the switcher? I want the following adjustments:
- no thin line around it
- no background change on hoover
- current language to be black on hoover

Thanks!

July 23, 2019 at 4:57 am #4262631

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The styles can be overridden using the custom CSS.

The language switcher by default doesn't have these styles, As I have mentioned these styles are added from the theme.

Kind regards
Raja

July 23, 2019 at 1:31 pm #4266513

basv-25

Hi Raja, perfect, Salient helps me very well so I think we can get it fixed in a couple of days.

Thanks