WordPress.org

Ready to get started?Download WordPress

Forums

qTranslate
Writing html in the template file with multiple languages (4 posts)

  1. eplehans
    Member
    Posted 2 years ago #

    Hi everyone,

    How can I write some text, let's say <p>this is english</p> and <p>this is spanish</p>in the template file and make it work like the content I have posted from the WP dashboard with qTranslate?

    Thanks!

    http://wordpress.org/extend/plugins/qtranslate/

  2. eplehans
    Member
    Posted 2 years ago #

    I solved it guys.

    Just surround it with this:
    <?php if(qtrans_getLanguage() == "es") : ?>
    <h1>This is Spanish</h1>
    <?php endif ?>
    <?php if(qtrans_getLanguage() == "en") : ?>
    <h1>This is English</h1>
    <?php endif ?>

    And you're good to go!

  3. chiappa
    Member
    Posted 1 year ago #

    this made my day. thanks for sharing!

  4. clazzid
    Member
    Posted 1 year ago #

    this should do it as well:
    <?php _e("<!--:en-->english text<!--:--><!--:es-->spanish text<!--:-->"); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags