1

I´ve been dealing with a qtranslate problem (Im using the twentyten theme) and i hope you cna help me, I´ve been searching on forums and sites but to no vail (their solution is for other them called atahualpa).

First of all the loading speed is too slow. The other problem is that I have a static page that for now uses the "Yet Another Related Posts Plugin" plugin because it is the only plugin I found that shows the recent posts list with a featured thumbnail (but I have the problem that it does not break lines for the expert texts) , and then in other pages I use the "NuRelm Get Posts" to get a list of recent post of a certain cathegory (like here http://eltemadehoy.net/?page_id=11 ).

My problem is that in this "NuRelm Get Posts" (besides being unable to use thumbnails) all the titles of the posts that are translated with qtranslate are shown continous VG "Porque al mundo le importa la independencia de Escocia.Why The World Cares About Scotland´s Independence."

So the titles appear in both languages one after the other. I have some content that is translated and some that isn´t but might be in the future. for now I simply leave blank the other untranslated language title, content and excerpt of a post. But those are are translated invariably get a duplicated title.

Help please.

1 Answer 1

5

Check the code that is used by NuRelm Get Posts, it's very likely that it outputs the title using something like

echo $post->post_title;

To have the title translated by qTranslate,the plugin must use the standard function of Wordpress, in this case the_title, that is applying the filters that qTranslate use to render the text multilanguage.

Use:

echo apply_filters('the_title',$post->post_title)

instead.

Remember: this must be DONE in the plugin. Contact the author or substitute it and send the patch to the authors.

4
  • Hi. there is code in qtranslate_configuration.php and in Commented Apr 10, 2012 at 21:10
  • Hi, I solved in another way since changing the codethe_titlecode makes the site to crash. Instead of dealing with qtransalte in the Nurelm Get Posts php I changed : code if (isset($fields_classes_list[$i])) { $content = $content . "<span class=\"" . trim($fields_classes_list[$i]) . "\">"; }code For: if (isset($fields_classes_list[$i])) { $content = __($content . "<span class=\"" . trim($fields_classes_list[$i]) . "\">"); } Commented Apr 12, 2012 at 23:20
  • 1
    The addition of the filter in the code works perfectly for me.
    – Vince P
    Commented Nov 6, 2012 at 11:01
  • Worked like a charm! Commented Jun 1, 2019 at 3:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.