• Resolved gstricklind

    (@gstricklind)


    Anyone know what the php code would be to add this to the header.php instead of using a widget? It’s been a long time since I’ve checked this plugin out, and I vaguely don’t remember using a widget to make this work.

    Also, am I missing a setting that hides the default language option if that is the current being used? If I’m viewing the site in English, it doesn’t seem like the link for the English version should be available, just the other languages. Thoughts?

    Thanks.

    http://wordpress.org/plugins/qtranslate/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I use code like this in my theme’s content.php for the single article view:
    <?php echo qtrans_generateLanguageSelectCode('both'); ?>
    (from the qTranslate FAQ)

    From what I see in qtranslate_widget.php (Lines 116 and 117), you could overwrite the ‘active’ class in your CSS to have something like “visibility: hidden” to hide the current language and only show the others (totally untested! ;)).

    Thread Starter gstricklind

    (@gstricklind)

    Oh, perfect! Thanks! I’ve been working with php and hooks so much I completely forgot about using a css trick.

    Did you ever resolve this I am having this issue currently

    Thread Starter gstricklind

    (@gstricklind)

    Yeah, just use the php code provided by Simon.

    If you’re referring to the css, I used this:

    #qtranslate-chooser li.active {
    display: none !important;
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php code instead of widget?’ is closed to new replies.