Add a mQtranslate language selector to your header

Written By :

Category :

fedora

,

General

,

guias

,

Linux

,

Wordpress

Posted On :

Share This :

After a massive migration of all my personal and clients websites to mQtranslate, there are some things that you need to add, mostly, when you work with custom front pages, one of those is the language selector at the header. Process as always is quite simple, so let’s get to it. First is to add the instruction that calls the active languages to the header:<?php qtrans_generateLanguageSelectCode(); ?>Then, you just need to add some stile. I would recommend you to add all the css tags for each language you will use, since right now, i haven’t found an easy way to add them automatically without needing jquery (if you know a better way, please let me know!)As you can see, is quite simple; and with a good style things won’t look too crappy. For this example I used a rounded icon shape using just css (border-radius) and the theme color. Try to not use images, so you can change it easily. You will always have the option to add a personalized widget to your header, and from the admin just drag the mQtranslate box. Mostly, this method is due curiosity… curiosity is what makes us learn something different every day.qtrans_language_chooser { display: inline; list-style: none; float: right; margin-top: 10px; } .lang-eu { background: rgb(62, 129, 214); border-radius: 20px; padding: 5px; } .lang-es { background: rgb(62, 129, 214); border-radius: 20px; padding: 5px; margin-bottom: 4px; } .lang-es a, .lang-eu a { color: #ffffff; font-family: ‘Patua One’, cursive; text-align: center; }