What is a theme textdomain in WordPress?

Posted by Rohit Kumar | Updated on

What is a theme textdomain in WordPress?

Making a Theme translation-ready requires a few steps.

  1. Define the Theme’s textdomain:
  2. Define translatable strings in the template.

    This is done using one of a few translation functions: __() (for returned strings), _e() (for echoed strings), and _x()/_ex() (for gettext context strings). There are others, but you get the idea…

    A static text string, such as <p>Hello world!</p>, is wrapped in an appropriate translation function, such as <p><?php _e( 'Hello World!', 'themify' ); ?></p>, to make it available for translation.

  3. Generate the .mo/.po files

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers