Support » Theme: Mantra » qtranslate language selector on header

  • Resolved llampderellamp



    In first place, thank you for the Mantra theme. I’m newbe in the Wp world, I’m building my first blog and until I found your theme I was completely lost. Mantra is powerful but easy to configure. I know this is not easy to achieve. Congratulations!!

    I’m using qTranslate to build a multilanguage blog. I have decided to place the language selector inside the header banner instead of using the provided widget.

    Surfing the net I learned that is necessary to insert in the header.php this little piece of code: qtrans_generateLanguageSelectCode(‘image’);

    I tried to do it, but I have only been able to put the flags over the logo or under the logo, but not inside it, in its right top corner. Please, could you indicate me in what exactly place has to be inserted the function call?

    Thanks in advance!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Well, there is no much help activity here …

    I really need to put the language selector on the header, because my blog have no sidebar, and if I put the language selector widget in the footer, possible readers will left before they know that it is written in a language they know.

    As I’m not been able to put the language selector inside the banner image, I have decided to put it under the banner, just before the main menu. I think that the resulting look is quite good. You can check it here:

    If you want to apply the same solution, what you have to do is copy this lines I’ve found surfing the web, in the Mantra’s header.php:

    <?php if (function_exists(‘qts_language_menu’) ) qts_language_menu(‘image’); ?>

    The right place to insert it is just after the “branding” div block.

    You can change “image” by “text” or “both”.

    Then, in the Mantras configuration menu, section “Miscellaneous settings”, add in the custom css field the following lines:

    .qts-lang-menu { list-style-type:none; float:right }
    .qts-lang-menu li { float : left; margin-right: 20px; margin-top: 10px; }

    That’s all!!

    I have had to uninstall the qTranslate-Slug from my wordpress because it was responsible of Mantra’s pagination malfunction.

    After doing it, I noticed that the solution I posted few months ago only works if you have installed the qTranslate-Slug plugin, because the php function used belongs to qTranslate_Slug, not to qTranslate.

    Fortunately, qTranslate have the equivalent functions. So, if you don’t have the qTranslate-Slug plugin installed, use this piece of code instead the one introduced in the previous post:

    <?php if ( function_exists( ‘qtrans_generateLanguageSelectCode’ ) ) qtrans_generateLanguageSelectCode( ‘image’ ); ?>

    It shall be placed as it is explained in the previous post.

    The css code it is also a little different:

    #qtranslate-chooser { list-style-type:none; float:right }
    #qtranslate-chooser li { float : left; margin-right: 20px; margin-top: 10px; }

    I hope this clarification will be useful!

    I was looking for this solution.
    This one works!
    Thank you very much!

    Works for me too!
    Thank you so much!

    Works for Flexible theme by Elegant Themes to.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘qtranslate language selector on header’ is closed to new replies.