Forums

Why do themes have their names all throughout the files? (3 posts)

  1. Nneon
    Member
    Posted 1 year ago #

    I've always wondered this but never taken the time to understand or figure out why different themes have their names all throughout the files.

    Like here in the 404.php of the new Twenty Ten theme:

    <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>

    An explanation of why they are there and weather they are necessary or not would be greatly appreciated ;)

  2. ClaytonJames
    Member
    Posted 1 year ago #

    I think that is a feature designed to localize themes. It's possible that the function <?php _e( 'Not Found', 'twentyten' ); ?> would print the string "Not Found", while "twentyten" indicates the "theme_textdomain" where language files can be found for localization (translation?). I believe the actual path to the language files would be described in the themes functions.php file. In twentyten, I think this is it:

    // Make theme available for translation
    // Translations can be filed in the /languages/ directory
    load_theme_textdomain( 'twentyten', TEMPLATEPATH . '/languages' );

    My best guess as a novice, would be that "php_e" prints the phrase "Not Found", and "twentyten" describes the path where the language files can be found..

    ....At least, I think that's what it means. Maybe someone who knows for sure will confirm or correct my thinking.

    :-)

  3. zotsf
    Member
    Posted 1 year ago #

    I'm interested in this as well. Is what ClaytonJames saying above the correct answer?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.