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

I have a function which redirects user to certain page:


Usually I would just use:

<?php _e("<!--:en-->english permalink<!--:--><!--:de-->german permalink<!--:-->"); ?>

But this is specific situation and I can't use it this way...

Any idea how to do this?


share|improve this question
What's the previous decision that has to be taken before redirecting? – brasofilo Apr 22 '13 at 20:03
Whole function:pastebin.com/b4LsXRpg – HunterListInsight Apr 22 '13 at 20:08
You can edit your Q and add the code to it. But I don't see how the "language logic" applies in that function. – brasofilo Apr 22 '13 at 20:11
up vote 1 down vote accepted

Are we talking permalinks here or any URL? If any, create an array( 'en' => 'en_url', 'de' => 'de_url' ); and get the URL by accessing the array using qtrans_getLanguage() index.

If you're translating internal permalink use the qtrans_convertURL() function.

share|improve this answer
Awesome, this works! Whole code: pastebin.com/fDLbjtrB – HunterListInsight Apr 22 '13 at 20:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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