ThemeShaper Forums » Thematic

[closed]

Is it required to have theme name and why?

(3 posts)
  • Started 10 years ago by ikennaugwuh
  • Latest reply from ikennaugwuh
  • This topic is not resolved
  1. Ok, this question is smarter than it looks, hear me out

    I was wondering when theming if it is required to have your theme name commented after everything you do, as in the example:

    <?php printf(__("blah blah blah.", "theme-name")?>
    or
    <?php $blahVariable = array(__('Info', "theme-name") =>'blah_blah_info',
    array(__('Other', "theme-name") =>'blah_blah_info',
    array(__('More', "theme-name") =>'blah_blah_info'
    ); ?>

    Do you really have to include the (Whatever, "theme-name") and if so why? Is it required by WordPress? I just haven't been able to understand the concept or had the time to find any information on it anywhere. Is there a way to just declare the name of your theme once?

    Posted 10 years ago #
  2. no it isn't required. it has to do with translation.... i think it marks those strings as strings that need to be translated to move your theme into another language.

    __('a string'); returns the translated value
    _e('a string'); echos the translated value

    http://codex.wordpress.org/Translating_WordPress

    Posted 10 years ago #
  3. Oh ok! Thank you, you really cleared this up!

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.