Support

Account

Home Forums Front-end Issues True / False field with qTranslate question

Solved

True / False field with qTranslate question

  • Hi there,

    I would like to know how I need to put this code from qTranslate:

    <?php _e("<!--:en-->For Sale<!--:--><!--:nl-->Te koop<!--:-->"); ?>

    into this code:

    <?php if( get_field('te_koop') )
    {
    echo '<span class="sale">Te Koop</span>';
    }
    else
    {
    echo '';
    }
    ?>
    • flowbob

    • February 6, 2014 at 9:35 am

    I’m not quite sure what you want to achieve.

    What i can say is, that your if statement needs an expression of the type boolean, which your field probably isn’t. (read this)

  • Thanks for your respons.

    I figured it out, I made another if statement within like this:

    <?php
    if( get_field('te_koop') )
    {
    	if( qtrans_getLanguage() == 'en' ){
    		echo '<span class="sale">For sale</span>';
    	}
    	else 
    	{
    		echo '<span class="sale">Te koop</span>';
    	}
    }
    else
    {
    	echo '';
    }
    
    ?>
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.