Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mtonumaa

    (@mtonumaa)

    bump

    Thread Starter mtonumaa

    (@mtonumaa)

    I got it sorted!

    For all you qtranslate fans, here’s how to display multilingual content in sidebar area on specific pages:

    1. Add this code in your sidebar.php:

    <?php
    if (qtrans_getLanguage() == 'ee')
    { $eesti = get_post_meta($post->ID, "eesti_value", true); } 
    
    elseif (qtrans_getLanguage() == 'en')
    { $english = get_post_meta($post->ID, "english_value", true); }
    else ?>
    
    <?php if($eesti or $english !== '') { ?>
    <dl>
    <?php if($eesti !== '') { ?>
    <dd>
    
    <?php echo $eesti; ?></dd>
    <?php } ?>
    
    <?php if($english !== '') { ?>
    <dd><?php echo $english; ?></dd>
    <?php } ?>
    </dl>
    <?php } ?>

    2. Admin > Page > Custom field

    Custom field name eesti_value
    Custom field value <p>This content is in Estonian.</p>

    Custom field name english_value
    Custom field value <p>This content is in English.</p>

    Thank you mtonumaa its also help me..

    Hi mtonumaa, very useful! after a long search I found it! Thanks alot!

    I d like to ask you one question. You have probably worked with custom fields. Another thing I am searching for is how to make a multilingual content from html code.

    Example:
    <b>Stav <?php echo get_post_meta($post->ID, 'stav', true); ?></b>

    – where I need somehow to get “Stav ” in my all three languages, i use on my site. The usuall tags <!–:en–>Stav <!–:–><…. i use obviously doenst work.

    Thanks a lot again for the code upstairs and it would be really kind, if u can help me or give me some clue for my another problem.

    Jirka

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Displaying custom field/widget with qTranslate?’ is closed to new replies.