WordPress.org

Ready to get started?Download WordPress

Forums

xili-language
[resolved] Cannot use functions (5 posts)

  1. delythchandler
    Member
    Posted 1 year 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?

    http://wordpress.org/extend/plugins/xili-language/

  2. Michel - xiligroup dev
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

    M.

  5. delythchandler
    Member
    Posted 1 year 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

About this Topic