Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter silu44

    (@silu44)

    i’m using page builder to generate post’s blocks on homepage

    Hi
    I had some similar problems (I don’t recall exactly, but one problem was coming of the fact that I was using a static homepage, which is probably what you’re doing) but I made this code and added it to my functions.php

    // Correct the loop on main page so that qtranslate excludes posts correctly
    function my_qtrans_excludeUntranslatedPosts($where) {
    	global $q_config, $wpdb;
    	if($q_config['hide_untranslated'] && !is_singular()) {
    		$where .= " AND $wpdb->posts.post_content LIKE '%<!--:".qtrans_getLanguage()."-->%'";
    	}
    	elseif($q_config['hide_untranslated'] && is_singular() && !strpos($where, "wp_posts.post_type = 'post'") && !strpos($where, "wp_posts.post_type = 'page'")) {
    		$where .= " AND $wpdb->posts.post_content LIKE '%<!--:".qtrans_getLanguage()."-->%'";
    	}
    	elseif($q_config['hide_untranslated'] && is_front_page()) {
    		$where .= " AND $wpdb->posts.post_content LIKE '%<!--:".qtrans_getLanguage()."-->%'";
    	}
    	return $where;
    }
    if(!defined('WP_ADMIN')) {
    	remove_filter('posts_where_request', 'qtrans_excludeUntranslatedPosts');
    	add_filter('posts_where_request', 'my_qtrans_excludeUntranslatedPosts');
    }

    The part with WP_ADMIN is to ensure that all articles will be loaded when you’re on the dashboard. Play with this code and see if it helps!

    Hi,
    I have the same problem.
    I published posts and pages in Japanese and install mqTranslate.
    Both Japanese and English(***/en/) page is shown in Japanese language in spite of checking “Hide Content”.

    I’ve done, Advanced Settings > Convert Database > click “to mark all existing posts as written in the default language”.
    And adding above code to my functions.php also does not work as before.

    Thread Starter silu44

    (@silu44)

    Hello ,

    in my case , i solved the problem by adding the translated version of each category

    for example : if you use two languages (fr and en ) and you have News category so you need to add the equlivant cat for french

    Thank you,

    I tried to add all the translated categories for another language.
    But it does not still work.

    Only way to solve this problem I’ve confirmed is to go through all my posts manually and save them. However, it is too large.

    Thread Starter silu44

    (@silu44)

    Please try :

    1- disable all plugins just leave mqtranslate and do the folowing
    2- create another Super admin account and sign in with it
    3- do Advanced Settings > Convert Database > click “to mark all existing posts as written in the default language”.

    I’ve done as described above, but it does not work yet…

    Facing the same problem here, any help will be appreciated.

    Thread Starter silu44

    (@silu44)

    just send me your admin panel to see what i can do .
    sometimes it depend on version of wp , mqtranslate , sometimes deactivated plugins may cause this error

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hide Content which is not available for the selected language.’ is closed to new replies.