Adding a widget in header

Hello!

I would like to add the Polylang widget in the header of my website. Does someone know how I can do that?

Here is a link to the website: http://krisidesign.com/. I want it to appear above the menu.

Thanks,
Krisi

Hello there,

From menu administration panel (Appearance > Menus), add a language switcher menu item. Then do these steps to move it above the menu items:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    (function($){

      if( $('.lang-item').length ) {
        $('.lang-item > a').remove().clone().appendTo('.site-header').wrapAll('<div class="lang-switcher-menu"></div>');
      }

    })(jQuery);

4 . Update
5 . Add this CSS code to Appearance > Customize > Additional CSS from dashboard.

    .site-header {
      position: relative;
    }

    .lang-switcher-menu {
      position: absolute;
      top: 40px;
      right: 15px;
    }

    .lang-switcher-menu a {
      display: inline-block;
      margin-right: 10px;
    }

    @media only screen and (min-width: 768px) {
      .lang-switcher-menu {
        right: 30px;
      } 
    }

Regards,
Kharis

Thank you for the help! :slightly_smiling_face:

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis