Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For the most part the plugin List Category Posts works great.

I just have one problem with it: when I try to show the title and excerpt of a post it shows all translations at the same time, rather than just the translation relative to the selected languages.

I'm using qTranslate for the languages. I'm not sure how to fix that.

share|improve this question
    
How are you showing the title and excerpt? Can you add the relevant code to your question? Or a link to a snapshot? –  brasofilo Jun 26 '12 at 12:18
    
thanks for your quick reply. for example on the following page: yoga-dinamico.hl53.dinaserver.com/en/talleres , using the plugin "list category post", i try to show a list of all the posts from a cateogry with this code: [catlist name=talleres thumbnail=yes thumbnail_size=52,52 excerpt=yes]. in the footer, in the Archive section is happening something similar. –  bilyana Jun 26 '12 at 15:54
    
Well, let's hope the plugin author see this post, because that's a handicap of LCP. Anyway, there are solutions on WordPress forums on how to hack the plugin to make it work with qTranslate... Saludos! –  brasofilo Jun 26 '12 at 16:11
    
thank you so much. i found a hint towards the solution exactly where you advised me. i think the solution was a bit outdated,but with a bit of digging, i made the following change: in file include/CartListDisplayer.php, in function get_post_title() i added the following code in first line before anything else: if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) { $single->post_title = esc_html(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($single->post_tit‌​le)); }. needs to be done with all other fields that need translation.thank you so much –  bilyana Jun 27 '12 at 9:58
    
bilyana, glad to hear, but please answer your own question and in a couple of days mark it as the correct one. Haven't said, but benvingut a WPSE! –  brasofilo Jun 27 '12 at 10:21

1 Answer 1

up vote 1 down vote accepted

I found a hint towards the solution exactly where you advised me. I think the solution was a bit outdated, but with a bit of digging, I made the following change:
in file include/CartListDisplayer.php, in function get_post_title() I added the following code in first line before anything else:

if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) 
{ 
    $single->post_title = esc_html(
        qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $single->post_tit‌​le )
    ); 
} 
share|improve this answer
    
This solution worked for me but copy-pasting directly did not, there was an encoding issue of some sort with the "$single->post_tit‌​le" part so I had to copy-paste that from further down in the CartListDisplayer.php file. –  Kristofer Nov 25 '12 at 19:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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