Support » Fixing WordPress » Plugin to specify language of individual pages

  • Hi

    I’m running a bilingual site and would like to specify the langauge of a page. I don’t need a translation tool, just something that lets me specify the languae in the document head.

    Thanks in advance


Viewing 2 replies - 1 through 2 (of 2 total)
  • hi jezbutler, if you are talking about the language attributes for the html tag take a look at the language_attributes hook, if you mean the language meta tag, you can just hook in wp_head and echo it.

    In short it could look something like this:

    // result: <html lang="en-US"> or <html lang="de-DE"> depending on $use_english
    add_filter('language_attributes', $use_english ? 'en-US' : 'de-DE');

    Here is a post I wrote about specifying the language tag and I also wrapped it up in a plugin. I do not know how you would decide which language a post is, but it should also be quite easy to add an option to the “add new post”-page and set the language info on a per-post basis manually.

    Thanks very much… I’ll investigate shortly!



Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin to specify language of individual pages’ is closed to new replies.