I am building a custom solution that would be bilingual in English and French. I want to store the French content, title,... in custom metas by adding META BOXES to the edit screen. This part is fine, I can take care of it without a probalem.


I can detect the language of the user by using substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); no big deal here either.

Now, depending on the user's language I want the loop to server either the main content ( you know the_content() or the_title(),... ) or the translated version by running some filter.

Which code would I have to code in the plugin or functions.php ?

  • I hate doing this, but I would recommend using a multi language plugin for this job, something like polylang. Basically what you are asking here is to code a plugin for you, which that does not go well here. – Pieter Goosen Jul 25 '14 at 7:17
  • I am not asking for a plugin. I am a plugin developer myself. I just want to slightly filter the_content and the_title by passing the language parameters. Anyways, I have an idea but thlugh someone might have done it already. – Janvier Jul 25 '14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.