WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
<?php _e( $text, $domain ) ?>


(string) (optional) Domain to retrieve the translated text Default: 'default

can't understand the second argument well. when i custom a theme, where the $domain's value shows on the theme, what value should i give it to.? could i write the $domain part optionally?i see some themes using its theme name as the $domain. but the document says Domain to retrieve the translated text.it's not a domain. why? some using other strings which doesn't have any relevance of the theme?

share|improve this question

$domain is the unique identifier for retrieving translated strings.

It is set in functions.php

<?php load_theme_textdomain( $domain, $path ) ?>


load_theme_textdomain('my_theme', get_template_directory() . '/languages');

<?php _e( 'Translate this text', 'my_theme' ) ?>

If you don't have a translation file but want't to make it translatable just define the textdomain.


share|improve this answer
if i don't have the languages file. how do i do? – enjoylife May 31 '11 at 0:34
it is not absolutely necessary to have a languages file, for example the translation plugin WPML can also translate the strings within the Dashboard, without the need for a .mo file. – Piet May 31 '11 at 1:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.