2016-06-27 7 views
0

WPMLとquery_posts()に問題があるクライアントがあります。WPML Query_posts

投稿はデフォルト言語で表示されますが、スペイン語版のサイトでは表示されません。

フォールバックh2が表示されます。

The site

The Spanish site

enter image description here

enter image description here

<ul class="news"> 

         <?php 
    query_posts(array(
     'post_type' => post, 
     'posts_per_page' =>2, 
     'order' => DESC, 
     'suppress_filters' => 0, 

    )); 
?> 
     <?php if (have_posts()) : ?> 
     <?php while (have_posts()) : the_post(); ?> 

          <li> 
           <div class="ico-holder"><img src="<?php bloginfo('template_directory'); ?>/images/ico-pen.png" width="25" height="27" alt=""></div> 
           <div class="text"> 
            <strong class="title"><a href="<?php the_permalink(); ?>"><?php the_title()?></a></strong> 
             <p><?php echo strip_shortcodes(wp_trim_words(get_the_content(), 10)); ?> </p> 
            <time class="date-time" datetime="<?php the_time(get_option('date_format')); ?>"><?php the_time(get_option('date_format')); ?></time> 
           </div> 
          </li> 
      <?php endwhile; ?> 
     <?php else : ?> 
     <h2> 
     <?php _e('Nothing Found','text_domain'); ?> 
     </h2> 
     <?php endif; ?> 
</ul> 

私は配列に'suppress_filters' => 0,を追加しようとしたが、それは解決策を改善しませんでした。

ありがとうございました!

+0

あなたは 'WP_Query'を使って自分のクエリを作成しようとしましたか? - https://wpml.org/forums/topic/query_posts-returns-pages-in-original-language-instead-of-translated-ones/ – Lee

+0

投稿は実際に翻訳されていますか? – user1049961

+0

いいえ、私はそれがまったく表示されることはありません。彼らは最初に翻訳されなければなりませんか?そして、私はしていない。私は、デフォルトのページが正しく表示されているので、それがプラグインに特に関連していると考えました。 – Zaeo

答えて

0

答えは、翻訳版の投稿を作成することでした。 WPMLを初めて使用したのは、まだ完了していないことはわかりませんでした。プラグインは照会された投稿に言語カテゴリを追加します。

関連する問題