0

Im digging wordpress and started to look into templates to be specific blank themes/frameworks for making custom themes. I found "HTML5Blank" and was going through source code and found something i do not understand.

<h1 class="htittle"><?php _e( 'News', 'html5blank' ); ?></h1>

What is the part 'html5blank' doing? Its repeating everywhere. Its not in the comments so its got to be some part of wordpress codex but i dont know even what to google. More examples :

<h1><?php _e( 'About ', 'html5blank' ); echo get_the_author() ; ?></h1>

again there is... , 'html5blank' ) . Why is that here? Even more examples

<span class="comments"><?php comments_popup_link( __( 'Leave your thoughts', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span>

Here its repeating more times, i cant figure it out.

Then i went through the sourc of another blank framework called "Bones". Again same thing

<p><?php _e( 'This is the error message in the archive.php template.', 'bonestheme' ); ?></p>  

,'bonestheme' ?? what is this doing?

<h1><?php _e( 'Oops, Post Not Found!', 'bonestheme' ); ?></h1>
  • Have you even looked at this? – user40422 May 29 '15 at 23:30
  • I examined the codex but obviously superficial, but thanks for the link, I knew it was an easy question and I did not know how to search the codex for that. – riogrande May 30 '15 at 8:10
  • You can find the function by searching for wp [function name] in for example google. – user40422 May 30 '15 at 9:18
3

It's the text domain, used for translation. When you run something like this:

<?php _e( 'Hello World', 'html5blank' ) ?>

...WordPress will attempt to find the translated string in the loaded MO file for HTML5 Blank:

load_theme_textdomain( 'html5blank', 'path/to/language.mo' );
  • What will happen if i delete that ? Is this required? – riogrande May 29 '15 at 22:01
  • If you want to change the text just replace the whole snippet with a hardcoded value. – TheDeadMedic May 30 '15 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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