Conditional template tag

dev.xiligroup est en travaux Forums xili-language plugin Conditional template tag

Ce sujet contient 0 réponses et 3 voix, et a été mis à jour par  Anonyme il y a Il y a 11 ans, 7 mois.

Visualisation du message 5 (1 sur 5, 5 au total)
  • Auteur
    Articles
  • #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

    Anonyme

    Thanx for this fast answer, it works.

    #3161

    Anonyme

    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

    Anonyme

    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

    Anonyme

    Perfect!

Visualisation du message 5 (1 sur 5, 5 au total)

Vous devez être connecté pour répondre à ce sujet.