Title: _e()
Last modified: August 19, 2016

---

# _e()

 *  Resolved [dexteremmerich](https://wordpress.org/support/users/dexteremmerich/)
 * (@dexteremmerich)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/)
 * Sorry, I couldn’t seem to find this anywhere but I know someone must’ve asked
   it before. I know _e() is used for echoing things through WordPress, but I was
   reading a tutorial and the way the guy put it, he made it sound like it’s bad
   practice to not echo certain things through _e(), and instead make it just plain
   HTML.
 * Is there truth to this? If I was going to sell templates, should certain things
   be _e()’d instead of just placed in there? Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1604924)
 * [http://codex.wordpress.org/I18n_for_WordPress_Developers](http://codex.wordpress.org/I18n_for_WordPress_Developers)
   
   [http://codex.wordpress.org/Translating_WordPress#Localization_Technology](http://codex.wordpress.org/Translating_WordPress#Localization_Technology)
   have a read through there
 * it assists with localization (translation)
 *  Thread Starter [dexteremmerich](https://wordpress.org/support/users/dexteremmerich/)
 * (@dexteremmerich)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1604932)
 * Thanks, especially for such a speedy response! So, basically I should just use
   it everywhere the I’m displaying text, right?
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1604940)
 * If your theme supports translation, then sure it’s worth wrapping anything that
   is written text (ie. something written in your language) in a translatable string.
   Your theme needs to register an approprite text domain in order for those translatable
   strings to be of any use though (same applies to plugins).
 * In regard to what to wrap in translation strings, take this example..
 *     ```
       echo '<div class="wrapper">';
       ```
   
 * This would be totally pointless as..
 *     ```
       _e('<div class="wrapper">', 'theme_text_domainname');
       ```
   
 * There’s nothing to translate, the code is layout markup, that deals with display
   not written words.
 * However, take this example..
 *     ```
       echo 'Hello, i'm some text explaining or describing something';
       ```
   
 * vs
 *     ```
       _e('Hello, i'm some text explaining or describing something', 'theme_text_domainname');
       ```
   
 * The first string is written in english, and stuck in english, it’s hard-coded
   so to speak.
 * The second string is translatable, and assuming your theme has registered a text
   domain (required in order for anyone to make a translation) could be translated
   into another language.
 * For words, yes certainly make them translatable strings (why not?), but for layout
   markup it’s not necessary(nor correct impo), if you want to give users the ability
   to change markup(ie. HTML), you should supply an appropriate filter, eg. `apply_filters('
   my_filter', $example_var_holding_markup )`.
 * Does that help?
 *  Thread Starter [dexteremmerich](https://wordpress.org/support/users/dexteremmerich/)
 * (@dexteremmerich)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1604943)
 * Yup, that clears it up for me. Thanks so much!
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1604954)
 * You’re welcome…. 🙂
 *  [Xurok](https://wordpress.org/support/users/xurok/)
 * (@xurok)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1605145)
 * Hi thanks for those informations, I have another question about the “theme_text_domainname”
   part…
 * So when we use the following function in a .php file :
    `_e('<div class="wrapper"
   >', 'theme_text_domainname');`
 * Does it mean we must have a “theme_text_domainname-fr_FR.po” file located in 
   the same directory as the .php file ?
 * Thank you 🙂
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1605147)
 * The file should be placed wherever the domain is set to read language files from..
 * If the path (second parameter of load_theme_textdomain function) looked like 
   so..
 *     ```
       get_template_directory() . '/languages'
       ```
   
 * Then it would go into the theme’s languages folder.. ie. `wp-content/themes/YOUR_THEME/
   languages`
 * [http://codex.wordpress.org/Function_Reference/load_theme_textdomain](http://codex.wordpress.org/Function_Reference/load_theme_textdomain)
 * **Additional:** I’ve just spotted something important on the above link, and 
   i don’t know whether this is still true, but it appears the naming scheme differs
   for theme text domains (see the link), just wanted to point this out.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘_e()’ is closed to new replies.

## Tags

 * [bad practice](https://wordpress.org/support/topic-tag/bad-practice/)
 * [clean code](https://wordpress.org/support/topic-tag/clean-code/)
 * [_e](https://wordpress.org/support/topic-tag/_e/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/_e/#post-1605147)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
