Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Clause

    (@johnclause)

    Are you sure you use qtranslate-x? That function would have name qtranxf_generateLanguageSelectCode: https://qtranslatexteam.wordpress.com/faq/#LanguageSwitchingMethods

    You can only use the widget of qTranslate-X in your menu or sidebars or footers.
    now if you want to have to your header flags
    use this php code
    in this examples is for greek and english language..you have to change the English and Ελληνικ? with images of flags or other words and the ?lang=en or ?lang=el with the languages that you prefer
    also you can use css code for decorate your options

    <php?
    $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $changelanguage=str_replace("?lang=en","?lang=el",$actual_link);
    <span><a href='https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]?lang=en'>English</a></span>
    <span><a href='$changelanguage'>Ελληνικ?</a></span>
    ?>

    it works for me like a shortcode and i can place it every wher in my page

    Plugin Author John Clause

    (@johnclause)

    Thank you, @apoulakis, it is a good way for Query URL Modification Mode, however it will not work in other URL Modification modes.

    With PHP code, there is a simpler way, for example:

    $href = apply_filters('translate_url','','en');

    or

    $href = qtranxf_convertURL('','en',false,true);

    Here is an faq: https://qtranslatexteam.wordpress.com/faq/#DevelperNotes

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘flags in the header’ is closed to new replies.