Select Page

To use this tutorial, you need to find the current hearder.php file of your WordPress theme. (for example MH Magazine lite theme the header.php file is includes/mh-custom-functions.php)

first you need le the logo float to left. add the code to the style.css

line 110:    .mh-site-logo { padding: 20px; overflow: hidden; float: left;}

second you need add the fellowing code to the WordPress control panel ->Customizing ->Additional CSS

.hearderLanguange {
  margin-left: 75%;
  padding: 25px;
}
.lang-item {
  list-style: none;
}

Now you need go to the header.php file (in my case includes/mh-custom-functions.php). Insert the polylang short code into it.

echo '<div class="hearderLanguange">';
	pll_the_languages(array(//不顯示當前語言的旗子 show flag, not show name, hide current
		'show_flags'    => 1,
		'show_names'    => 1,
		'hide_current'  => 0,
	)); 
echo '</div>';

Reference: https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/