Sunday, October 16, 2022
HomeWordPress Developmentphp - WORDPRESS - GTranslate Plugin - Displaying Completely different Codes With...

php – WORDPRESS – GTranslate Plugin – Displaying Completely different Codes With if-else


I am attempting to point out completely different codes for various languages on the gtranslate WordPress plugin.

Here’s what I am attempting to do:

<determine>
                                <?php
                                $current_lang_code = $_SERVER['HTTP_X_GT_LANG'];
                                if ($current_lang_code === 'ru') { ?>
                                <img class="img-fit" src="https://www.mgc.com.tr/wp-content/uploads/2022/10/mgc-slider-rusca-v1-sks.jpg" alt="İstanbul Hukuk Bürosu">
                                <?php } else if ($current_lang_code === 'ar') { ?>
                                <img class="img-fit" src="https://www.mgc.com.tr/wp-content/uploads/2022/10/mgc-slider-arapca-v1-sks.jpg" alt="İstanbul Hukuk Bürosu">
                                <?php } else { echo do_shortcode('[metaslider id="6449"]'); } ?>
                            </determine>

So the concept is that I’ll present my slider on my Turkish unique web site and present the opposite two pictures on the translated variations, that are robotically translated by gtranslate plugin. It appears to work however typically it will get cached or exhibits the unsuitable picture (for instance, Russian picture if you end up on the Arabic web page, and so forth.). How can I make this work correctly?

I haven’t got any lively cache plugin proper now, however I’ll activate in the way forward for course.

Thanks, regards.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments