• ltg

    (@lararaider2)


    Hello,

    This is the end of my Footer:

    <div class="widgets">
    
    			 	<?php dynamic_sidebar('sidebar'); ?>
    
    			 </div>
    			 <div class="credits">
    			 	<p>&copy; <?php echo date("Y") ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo('name'); ?></a>.</p>
    <p>design by myself - <a href="http://www.adriaginger.com/web-design/"><u>SEE MORE</u></a></p>
    
    			 </div>
    
    			 <div class="clear"></div>
    
    		</div> <!-- /sidebar -->
    
    		<div class="wrapper" id="wrapper">

    And I would like to use qtranslateX to have the information “<p>design by myself – <u>SEE MORE</u></p>” in two languages, Spanish and English.. could you please help me? I tried all kind of qtranslate shortcodes, including the php ones, but didn’t get any results so far :/

    thx!

    https://wordpress.org/plugins/qtranslate-x/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Marcin

    (@marcinkopec)

    what kind of shortcode did you use? From where did you take them? I’m going to do almost the same.

    Thread Starter ltg

    (@lararaider2)

    I tried this kind of shortcodes:
    – [:en]English Text[:de]Deutsch[:]
    – <!–:en–>English Text<!–:–><!–:de–>Deutsch<!–:–>
    – <?php if(qtrans_getLanguage() == “es”) : ?>
    <h1>This is Spanish</h1>
    <?php endif ?>
    <?php if(qtrans_getLanguage() == “en”) : ?>
    <h1>This is English</h1>
    <?php endif ?>

    but the things is that I know very little about PHP so probably I didn’t even place’em in the write place :/
    That’s why I need some help, to help me integrate the PHP shortcodes properly in my footer code^^

    Marcin

    (@marcinkopec)

    I do like that, and it works.

    <?php
    $curLang = substr(get_bloginfo( 'language' ), 0, 2);
    if($curLang == 'en')
    	{
    	$mk_enter_your_mail = 'Enter your mail...';
    	$mk_about_us = 'ABOUT US';
    	$mk_terms = 'TERMS OF USE';
    	$mk_privacy = 'PRIVACY';
    	$faq = 'FAQ';
    	$contact = 'CONTACT';
    	}
    else{
    	$mk_enter_your_mail = 'Wpisz swój e-mail...';
    	$mk_about_us = 'O NAS';
    	$mk_terms = 'REGULARMIN';
    	$mk_privacy = 'POLITYKA PRYWATNOŚCI';
    	$faq = 'FAQ';
    	$contact = 'KONTAKT';
    	}
    ?>

    And then in the place where I want show text i use
    echo $mk_about_us;
    and so on.
    Text will be changing depending on pressed language button.

    Thread Starter ltg

    (@lararaider2)

    I really have no idea of php so I don’t know to to implement this code in my website :s
    Could you please show me how would u integrated in the code I put in the first post?

    I just want to have the information:
    <p>design by myself – <u>SEE MORE</u></p>`

    in 2 languages; the rest stays always the same^^

    By the way, instead of using “else{” as you did, wouldn’t be possible to use sth like “if($curLang == ‘es’)” to be more specific and in case I want to add a third language in the future?

    thx

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use qtranslate-x in the FOOTER of my WP site’ is closed to new replies.