Avoid variables, create strings: they will return the favor

WordPress allow you to personnalize the context in many ways by displaying the current tag or category, as the tag or category description, for example. But, when it comes to add strings from nowhere, like a heading section which isn’t a tag, author, category or whatever already build within WordPress, you find yourself left high and dry.

In Basics, I use a simple tricks: I just create some strings with the gettext and tools for l18n (internationalization) buid within WordPress. Paid for the .po file to adapt the content of these strings.

Say, you want display a title and a sub-title above your posts:

<header>
    <hgroup>
        <h1 class="section-title"><?php _e( 'Do you want to know more?', 'basics' ); ?></h1>
        <h2 class="section-description"><?php _e( 'Find here all the latest news about Basics', 'basics' ); ?></h2>
    </hgroup>
</header>

Just open the .po file within Poedit and translate or adapt the strings to fit your needs.