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 thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to set WPML language Switcher on the right hand side, above the default logo in AVADA theme.

Solution: Solution here: https://wpml.org/forums/topic/language-switcher-on-the-right-hand-side-above-the-default-logo-in-avada-theme/#post-2846965

This topic contains 2 replies, has 2 voices.

Last updated by patrycjaK-2 11 months, 4 weeks ago.

Assigned support staff: Noman.

Author Posts
October 23, 2018 at 6:47 pm

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)

October 24, 2018 at 2:57 pm #2846965

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

October 24, 2018 at 6:38 pm #2847637

patrycjaK-2

My issue is resolved now. Thank you!