WordPress.org

Ready to get started?Download WordPress

Forums

List category posts
QTranslate Issue (6 posts)

  1. asplash
    Member
    Posted 3 years ago #

    Hi,
    I have used this plugin with QTranslate but the listing shows both languages. Has anyone got this combination to work? The thread on the plugin website refers to code in an earlier version.

    Thanks in advance, Jane

    http://wordpress.org/extend/plugins/list-category-posts/

  2. muc089
    Member
    Posted 3 years ago #

    Same Problem to me.

    All different titles are concatenated to one big title :(.
    Trying to figure out where the catlist does it, or how to speparate the titles as they should be displayed.

    Thanks hope to get a answer, Adrian

  3. muc089
    Member
    Posted 3 years ago #

    Hi could not yet figure out if it works with list-category-posts
    but this is a link to some more information about the problem
    Making Plugin **** work with qTranslate

    greets Adrian,
    any hints welcome!!!

  4. muc089
    Member
    Posted 3 years ago #

    Hi Asplash,

    got the solution :D

    Just edit your default.php(or your own template) inside the list-category-posts/templates folder and replace the line:

    $lcp_display_output .= $this->get_post_title($single);

    with

    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
    
            $output = $this->get_post_title($single);
            $lcp_display_output .= qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($output);
    
        } else
        $lcp_display_output .= $this->get_post_title($single);

    Greets Adrian
    hopes it solves your problem too, Asplash

  5. tempor
    Member
    Posted 3 years ago #

    Hi,

    -concerning qtranslate and the new version of List category posts compatibility-

    in case you don't wish to use a template you can make these changes directly to CatListDisplayer.php (it affects only the titles):

    Qtranslate Multilingual Support for List Category Posts Plug

    find and replace this:

    private function lcp_build_post($single, $tag){
            $lcp_display_output = '<'. $tag . '>' . $this->get_post_title($single);

    with this:

    private function lcp_build_post($single, $tag){
        if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
    
            $output = $this->get_post_title($single);
            $lcp_display_output .= qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($output);
    
       	 } else
        		$lcp_display_output = '<'. $tag . '>' . $this->get_post_title($single);

    based on muc089 solution.

  6. natterjacks
    Member
    Posted 3 years ago #

    I had the same issue with the "WP Category Post List" and QTranslate plugin and was able to fix it with a similar solution, thanks!!!

    Here's the solution.....

    Find the following code in wp-category-post-list.php (you'll find 2 lines the same):

    $post_output .= '<a href="' . get_permalink($post->ID) . '" target="' . ((false == $instance['open_in'])? '_blank' : '_self') . '">' . $post->post_title . '</a>';

    Right above that add:

    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
    $post->post_title = esc_html(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
    }

    Do this for both entries to apply to normal posts and sticky posts.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic