Forums

[Plugin: qTranslate] Write post only in one language (5 posts)

  1. levani01
    Member
    Posted 1 year ago #

    Is it possible to write posts only in one language and doesn't display in other language anything at all? For example I have two languages on my website: English and Georgian. I want that when I write posts for example only in Georgian, it must be visible only when viewing site in Georgian language. Is it possible?

    Sorry for my English I'm from Georgia

  2. mkdotam
    Member
    Posted 11 months ago #

    Hi levani01, try following hack: in qtranslate_core.php on line 457, right under comment, add "return null;"

    // content not available in requested language (bad!!) what now?
    return null;

    Remember to do this after every plugin update.

  3. sjardim
    Member
    Posted 10 months ago #

    I managed to do it by reading what mkdotam said and changing the_loop.

    One of my loops look like:

    <?php query_posts('showposts=10&category_name=news'); 
    
        if (have_posts()) : while (have_posts()) : the_post(); 						
    
        $hasLanguageContent = get_the_title();
        if($hasLanguageContent != "") :
        //if title is not an empty string, show the code below
    ?>
    
        <div class="news-list">
            <a href="<?php the_permalink() ?>">- <?php the_title() ?></a>
        </div>
    
    <?php
    endif;
    endwhile;
    endif;
    ?>
  4. satarte
    Member
    Posted 10 months ago #

    sjardim where is that loo? in archive.php or in a single post?
    I'v added
    return null;
    right after
    // content not available in requested language (bad!!) what now?
    in qtranslate_core.php but it doesn't appear to be working. I cant see any hangings in any loop. Here's by page: http://www.coldtwilight.com/ - site second post should only appear in polish language.

    If I could make this work, I could finally ignore other problems with this plugin. Can you please advise me something?

  5. levani01
    Member
    Posted 4 months ago #

    Has anything changed about it new version of qtranslate?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags