Conditional template tag

dev.xiligroup is being renovated Forums xili-language plugin Conditional template tag

This topic contains 0 replies, has 3 voices, and was last updated by  Anonymous 12 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3158

    xiligroup dev
    Keymaster

    you have to use the_curlang() function with slug of target language

    like that

    if (the_curlang() == 'en_us' ) {

    echo 'this page is in english' ;

    }

    #3160

    Anonymous

    Thanx for this fast answer, it works.

    #3161

    Anonymous

    Another question: I have a query: query_posts(‘category_name=loremipsum&showposts=3’). As a result, I get the 3 last posts for the category, but not in the proper language.

    Is-there a way to add: query_posts(‘category_name=loremipsum&showposts=3&lang=the_curlang’) ?

    ThanK you

    #3162

    Anonymous

    The idea is good but the php syntax must be fixed because the result of the function must be concatened :

    query_posts( 'category_name=loremipsum&showposts=3&lang=' . the_curlang() )

    #3150

    Anonymous

    Perfect!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.