Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
WordPress Theme Development

Translation and Internationalization in Themes

Make all user-facing strings translatable with a text domain.

Translation and Internationalization in Themes — a practical guide to WordPress theme i18n with clear examples you can reuse in real projects.

WordPress Theme Development Series (78/96). Prefer one article? Read the complete WordPress theme development tutorial.

Short description

Load the theme textdomain and wrap strings with `__()`, `esc_html__()`, `_e()`, etc.

Load textdomain

add_action('after_setup_theme', function () {
  load_theme_textdomain('acme-theme', get_template_directory() . '/languages');
});
esc_html_e('Read more', 'acme-theme');

Leave a reply

Your email address will not be published. Required fields are marked *