iDevApp › WordPress plugins › Bilingual TH/EN

iDev Bilingual TH/EN

A Thai / English site without duplicate pages: enter the English title, excerpt and content in a box under the editor, English menu and category names, a TH / EN switch, and every iDev plugin shows the visitor’s language.

  • Version 1.0.0
  • WordPress 6.2+
  • PHP 7.4+
  • Language Thai / English

1Features

  • A box for the English version on every post and page: title, excerpt, content · empty fields show the Thai
  • English menu names and English category names
  • English site name and tagline
  • A TH / EN switch as buttons or a dropdown, added to the menu automatically or placed with a shortcode
  • Links ?lang=en / ?lang=th and the chosen language is remembered in a cookie
  • The text of every iDev plugin (appointments, registration, schedule, cookies, etc.) follows the visitor’s language

2Getting started

  1. Language settings

    iDevApp › Bilingual TH/EN Choose the default language, the English site name and tagline, the menu for the switch, the switch style and which content types have an English version

    iDevApp › Bilingual TH/EN
    iDevApp › Bilingual TH/EN
  2. Enter the English content

    Open a post or page and scroll down to the English version box under the editor (in the block editor it is in the Meta Boxes panel at the bottom)

  3. Translate menus and categories

    Menus: Appearance › Menus open a menu item → English menu names · Categories: Posts › Categories → Edit → English name

3Shortcodes and developers

Shortcode / linkResult
[idev_lang_switch]TH | EN buttons
[idev_lang_switch style="dropdown"]Language dropdown
?lang=en / ?lang=thadd to any link to switch language
<?php
// In a theme or plugin
if (idev_lang() === 'en') { /* ... */ }
echo esc_html(idev_pick('ติดต่อเรา', 'Contact us'));

4Troubleshooting

Some pages stay in the old language after switching

This is usually page caching (Varnish, WP Rocket, Cloudflare APO, etc.). Exclude the cookie lang or turn on Don’t let browsers cache pages

English pages still show Thai content

Empty English fields show the Thai on purpose. Fill in the English version box of that page