 patrycjaK-2
|
I am trying to: set the WPML language Switcher on the right hand side above the default logo in AVADA theme
Link to a page where the issue can be seen: hidden link
I expected to see: Language switcher in the very top right corner of the website
Instead, I got: the language switcher in the very top left corner.
I have tried following the thread: https://wpml.org/forums/topic/custom-language-switcher-deennl-above-logo-in-avada-with-side-header-cafe/
Do not know where to put the code snippet from the last post (in the header.php in the Child theme)
|
 Noman
Supporter
Languages:
English (English )
Timezone:
Asia/Karachi (GMT+05:00)
|
Hi,
Thank you for contacting WPML Support. I have commented out below code from your child theme header.php file:
if(function_exists('icl_get_languages')):
$languages = icl_get_languages('skip_missing=1&orderby=custom');
if(count($languages) >= 1):
foreach((array)$languages as $language):
?>
<span class="icl-<?php echo $language['language_code']; ?><?php echo $language['active'] == 1 ? ' icl-current' : ''; ?>">
<a rel="alternate" hreflang="<?php echo $language['language_code']; ?>" href="<?php echo $language['url']; ?>"><img src="<?php echo $language['country_flag_url']; ?>" alt="<?php echo $language['native_name']; ?>" title="<?php echo $language['native_name']; ?>" /></a>
</span>
<?php
endforeach;
endif;
endif;
- Added below code in header.php file for displaying custom language switcher:
<div class="custom-lang-switch clearfix">
<?php do_action('wpml_add_language_selector'); ?>
</div>
- Added below code in style.css file:
.custom-lang-switch {
padding-right: 15px;
padding-left: 15px;
}
.custom-lang-switch > div {
float: right;
margin-right: 9%;
}
Now it looks as in attached screenshot.
If you want to customize it then you can do it from WPML >> Languages > Custom Language switchers section.
Please let me know if this resolves your issue or you need further assistance.
Thank you
|
 patrycjaK-2
|
My issue is resolved now. Thank you!
|