Title: php code instead of widget?
Last modified: August 21, 2016

---

# php code instead of widget?

 *  Resolved [gstricklind](https://wordpress.org/support/users/gstricklind/)
 * (@gstricklind)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/)
 * 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/](http://wordpress.org/plugins/qtranslate/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Simon](https://wordpress.org/support/users/sdellenb/)
 * (@sdellenb)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/#post-4287287)
 * 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](http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=3&p=16#p16))
 * 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](https://wordpress.org/support/users/gstricklind/)
 * (@gstricklind)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/#post-4287308)
 * Oh, perfect! Thanks! I’ve been working with php and hooks so much I completely
   forgot about using a css trick.
 *  [plex0r](https://wordpress.org/support/users/plex0r/)
 * (@plex0r)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/#post-4287450)
 * Did you ever resolve this I am having this issue currently
 *  Thread Starter [gstricklind](https://wordpress.org/support/users/gstricklind/)
 * (@gstricklind)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/#post-4287451)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate.svg)
 * [qTranslate](https://wordpress.org/plugins/qtranslate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [gstricklind](https://wordpress.org/support/users/gstricklind/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/php-code-instead-of-widget/#post-4287451)
 * Status: resolved