1. Home
  2. Help Center
  3. Customization
  4. Language / Currency Selectors

If you want a multi-language or multi-currency site you can add the selector element on the Header or Footer

But those switchers use the values from other plugins, they don’t make the translation or currency conversion on their own. Let’s see how to make them work.

Language Selector

It requires a plugin, either Polylang https://wordpress.org/plugins/polylang/ or WPML https://wpml.org/

Both plugins work fine with the theme, your choice depends on the amount of features you want and your experience or budget.

Check the details of each plugin and follow the plugin documentation to configure your language. All of this is independent from the theme.

The only elements related to the theme are the selectors. You can insert the selectors on the Top Bar, Header, Footer and Off Canvas menus. The process is the same.

For example, in Appearance > Customize > Header > Top Bar add a new element to the desired section and select Language Selector.

All available locations:

  • Top Bar. Go to Appearance > Customize > Header > Top Bar
  • Main Header. Go to Appearance > Customize > Header > Header Layout (custom layout)
  • Footer. Go to Appearance > Customize > Footer > Footer Bar
  • Off-canvas Desktop. Go to Appearance > Customize > Header > Off-canvas Desktop
  • Mobile menu. Go to Appearance > Customize > Header > Mobile Menu

Other plugins, custom coding

If you are already using WPML or Polylang skip this section.

It’s possible to add support for other plugins with a custom list of languages. Follow the example and add your own list to wp-content/themes/goya-child/functions.php

function custom_goya_languages_list($langs) { $permalink = get_permalink(); $langs = array( "en" => array( "language_code" => "en", "active" => 1, "url" => $permalink . 'en', "native_name" => "English" ), "fr" => array( "language_code" => "fr", "active" => 0, "url" => $permalink . 'fr', "native_name" => "Français" ), "de" => array( "language_code" => "de", "active" => 0, "url" => $permalink . 'de', "native_name" => "Deutsch" ) ); return $langs; } add_filter( 'goya_languages', 'custom_goya_languages_list' );
Code language: PHP (php)

Adjust "url" => $permalink . 'en', with your own endpoint. It could be ?en for other plugins

Currency Switcher

This feature requires the plugin WooCommerce Currency Switcher https://wordpress.org/plugins/woocommerce-currency-switcher/

Just install the plugin and save your settings. Follow the plugin documentation.

Then go to the desired location and insert the Currency Selector

The available locations are the same ones as the Language Selector:

  • Top Bar. Go to Appearance > Customize > Header > Top Bar
  • Main Header. Go to Appearance > Customize > Header > Header Layout (custom layout)
  • Footer. Go to Appearance > Customize > Footer > Footer Bar
  • Off-canvas Desktop. Go to Appearance > Customize > Header > Off-canvas Desktop
  • Mobile menu. Go to Appearance > Customize > Header > Mobile Menu

Was this article helpful?

Related Articles