Special Offer: Buy All 48 Premium WordPress Themes for Just $74.99. Learn more

Insert Plugin Language Chooser in Header Top

Language Switcher

In case that you use a plugin for multilingual content on your WordPress site (i.e. qTranslate X). You may want to insert the Language Chooser widget (which comes with the plugin) to the header top right position. Here is a guide how it can be done:

1. Install and Activate the WP Editor plugin:https://wordpress.org/plugins/wp-editor/

It is a very useful plugin which allows you to edit files inside all of the theme folders:

WP Editor Plugin

 

2. Admin Panel -> Left Menu -> Appearance -> Theme Editor

then open inc/utilities.php

After this code (line 196)

// display social sites
if ( $displaySocial ) {
tishonator_show_social_sites( '<ul class="header-social-widget">', '</ul>', '<li>', '</li>',
tishonator_read_customizer_option('tishonator_header_opensocialnewwindow', 1) == 1, 16 );
}
?>

INSERT

<?php dynamic_sidebar( 'translate-widget-area' ); ?>

3. Save Changes

4. Open inc/actions.php

After

// II. Register Widget Areas (line 181)

INSERT

register_sidebar( array (
'name'              =>     __( 'Translate Sidebar', 'tishonator' ),
'id'              =>     'translate-widget-area',
'description'     =>  __( 'Widget area for qTranslate', 'tishonator' ),
'before_widget'     =>  '',
'after_widget'     =>  '',
'before_title'     =>  '',
'after_title'     =>  '',
) );

5. Save Changes

6. Admin Panel -> Left Menu -> Appearance -> Widgets -> Add the translate widget for countries to ‘Translate Sidebar’

7. Save Changes

Please Note: The above changes can be applied to the following themes: tArt, tBachFlowers, tBlogging, tFashion, tFengShui, tGymm, tHomeopathy, tInteriorDesign, tKidd, tMedicine, tMeditate, tPhotography, tPortfolio, tPsychology, tSpirituality, and tTourism.

 

About the Author

Tihomir Ivanov is a WordPress web developer, founder of tishonator.com, a fan of Linux and Open Source, a gym enthusiast, a vegan, a fan of minimalism, good movies and books :)

2 Responses to “Insert Plugin Language Chooser in Header Top”

    • Hi Nasarullah,

      Thanks for choosing a theme by us 🙂

      > I applied the first change and after that my site is not opening, please advise how to recover my site.

      Well, only applying the first step :

      < ?php dynamic_sidebar( 'translate-widget-area' ); ?>

      without applying the next step will cause an issue, because on that step we load widget, but it’s not yet defined.

      There are two options for resolving the issue:

      Option 1. Rollback the already applied change, simply delete the < ?php dynamic_sidebar( 'translate-widget-area' ); ?> code.

      Option 2. Apply all of the steps from the guide.

      Thanks,
      Tihomir
      Tishonator Team

Leave a Reply