WordPress.org

Forums

qTranslate
widget link, please help! (3 posts)

  1. ebenezer357
    Member
    Posted 2 years ago #

    Hi, in a widget im using this code:
    <td> <a title="Bibles" href="http://www.bibliadeldiscipulo.net/libros/"><!--:en-->Bibles<!--:--><!--:es-->Biblias<!--:--></a></td>

    I want that when my visitors are viewing the site in SPANISH this link takes them to http://www.bibliadeldiscipulo.net/es/libros/ i tried to code it like that but didn't work, it takes them to the english version.

    Please help me!

    thanks

    http://wordpress.org/extend/plugins/qtranslate/

  2. mustbuzz
    Member
    Posted 1 year ago #

    what about this

    <!--:en--><td> <a title="Bibles" href="http://www.bibliadeldiscipulo.net/libros/">Bibles</a></td><!--:-->
    
    <!--:es--><td> <a title="Bibles" href="http://www.bibliadeldiscipulo.net/es/libros/">Biblias</a></td><!--:-->
  3. mario22april
    Member
    Posted 1 year ago #

    Hi, I create this funstion to change all forgoten (not translated) text in page.
    Insert in end of yor index.php

    $out1 = ob_get_contents();
    ob_end_clean();
    function lang_shortcodes($matches) {
    if ($matches[2]==qtrans_getLanguage()){
    return $matches[4];
    } else {
    return '';
    }
    }
    $out1=preg_replace_callback('/(<\!--:)([a-z]{2})(-->)([^(<\!--:)]*)(<\!--:-->)/', 'lang_shortcodes', $out1); //die();
    echo $out1;

    And do not forget to insert ob_start(); on begining of this file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • qTranslate
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic