WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Search Light] Compatibility with WPML

[Plugin: Search Light] Compatibility with WPML

  • Hello there!

    I’ve installed the ‘Search Light’ plugin and it doesn’t work with WPML.

    Does anybody know to hack the code to make it work?
    I’ve tried contacting the coders but I didn’t get any answer..

    I tried to do it myself, but I couldn’t get to it.
    I know that WPML uses an ID to identify the translated posts and there is a php snippet to get the ‘lang’ code for each language.. that’s all.

    Thanks folks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think I just figured it out!!

    Go to “searchLight.php” on line 185:

    $sql_where = ” WHERE ” . $sql_where;

    and just add:

    $sql_where = ” WHERE ” . $sql_where . ” AND ID IN (SELECT element_id FROM wp_icl_translations WHERE language_code = ‘$lang’)”;

    Of course you have to specify the $lang, for that, just use:

    $lang = ICL_LANGUAGE_CODE;

    before the query.

    This has to be done too on line 200

    It seems to be working for me! 🙂

    Now I’d like to integrate the translation function, like:

    _e(‘Search results’, ‘youtheme’);

    But I can’t figure it out.
    I’ve done something, but then the CSS crashes… weird.

    I’ve got it!

    For example:

    echo '<h1>'.$count.' '. __('results', 'your_theme') .'</h1>';

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Search Light] Compatibility with WPML’ is closed to new replies.
Skip to toolbar