0

I am using mqTranslate and ACF Gallery to build a gallery. Below is the code.

<?php $images = get_field('home_slides', 'options'); ?>
<div id="slider" class="flexslider">
    <ul class="slides">
        <?php foreach( $images as $image ): ?>
            <li>
                <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
                <p><?php echo $image['title']; ?></p>
                <p><?php echo $image['description']; ?></p>
            </li>
        <?php endforeach; ?>
    </ul>
</div>

How can I display Title and Description in other languages? Since both [:en] and <!--:en-->Title<!--:--> are not working.

1 Answer 1

0
<?php echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage("<!--:en-->Hi<!--:--><!--:zh-->你好<!--:-->"); ?>

If you try the above line in English and Chinese, you'll see "Hi" and "你好".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.