WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

the problem is that on home page I have a lot of code which is added through header.php and it is not amendable through admin panel. What I want to do is to switch header files on language switch. Whenever a user press on the language icon, lets say on the English language icon the header should also switch from <?php get_header('mylanguage') ?> to <?php get_header('english') ?> or etc. Is it possible to do like this?


share|improve this question

closed as off-topic by Pieter Goosen, kaiser Nov 21 '14 at 0:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Following the codex about the get_header function

You must have an archive header-de.php in your template.

Create one for each language you have and adjust the switch accordingly.

if(function_exists('qtrans_getLanguage')) {
    $lingo = qtrans_getLanguage(); 
    switch ($lingo) {
        case 'de':
} else {
share|improve this answer
You don't event really need the switch. get_header will fall back to header.php if header-de.php doesn't exist. – chrisguitarguy Sep 11 '12 at 2:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.