[resolved] Cannot use functions (5 posts)

  1. delythchandler
    Posted 3 years ago #

    I am trying to use some of the built in functions, such as the_curlang() but any that I try to use, break the page.
    Can anyone help me please?


  2. Michel - xiligroup dev
    Plugin Author

    Posted 3 years ago #

    the_curlang() is a php function returning the slug of the current language usable like that inside the source of your theme (not in content of post):

    <h1>small example</h1>
    <?php if (the_curlang() == "en_us" ) {
    echo '<span>text</span>';
    } else {
    echo '<span style="color:red;">redtext</span>';
    } ?>

    List of functions are inside the plugin source and summarized here

    http://wiki.xiligroup.org/index.php/Xili-language:_functions (follow link in this post)

  3. delythchandler
    Posted 3 years ago #

    Thank you for your reply, I am already attempting to use the function in my template files.
    I have pasted your code above, and it still seems to break the page whenever I use the function the_curlang()

    I am using WP version 3.2.1 and plugin version 2.7.1

  4. Marcel Andrew
    Posted 3 years ago #

    do you sure that xili-language is activated ?
    are you easy in php coding ? have you test the function is active ?

    if ( function_exists('the_curlang' ) ) {

    Be more precise about error occurred


  5. delythchandler
    Posted 3 years ago #

    Sorry, my mistake, the plugin had been deactivated for some reason, works ok now activated.

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • xili-language
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic