WordPress: WP Category post list and qTranslate issues [SOLVED]

WP Category post list and qTranslate are two of the plugins I usually use when developing websites with WordPress.

When using both of them together, all different post titles are concatenated to one big title (which contains the titles in all languages concatenated).

To fix this, simply edit wp-content/plugins/wp-category-posts-list/includes/wp_cpl_output_get.php and change from:

/** Add up the actual permalink and post title */
                $post_output .= '<a href="' . get_permalink($post->ID) . '" title="' . __('Permalink to: ', 'wp-cat-list-itg') . $post->post_title . '" target="' . ((false == $op['open_in'])? '_blank' : '_self') . '">' . $post->post_title . '</a>';

to

if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
				$post->post_title = esc_html(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
			}
 
                /** Add up the actual permalink and post title */
                $post_output .= '<a href="' . get_permalink($post->ID) . '" title="' . __('Permalink to: ', 'wp-cat-list-itg') . $post->post_title . '" target="' . ((false == $op['open_in'])? '_blank' : '_self') . '">' . $post->post_title . '</a>';

And your titles will be displayed correctly in each language :)

One Thought on “WordPress: WP Category post list and qTranslate issues [SOLVED]

  1. ville on 20/02/2013 at 22:39 said:

    Sorry, but in what part of plugins is that? in the qTranslate? or just around?

    wp-content/plugins/wp-category-posts-list/includes/wp_cpl_output_get.php

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation