首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WPML Query_posts

WPML Query_posts
EN

Stack Overflow用户
提问于 2016-06-28 00:10:49
回答 1查看 268关注 0票数 0

我有一个客户,他对WPML和query_posts()有问题;

这些帖子以默认语言显示,但不以网站的西班牙语版本显示。

它显示了回退h2。

The site

The Spanish site

代码语言:javascript
复制
<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,添加到数组中,但这并没有解决问题。

感谢您的帮助!

EN

回答 1

Stack Overflow用户

发布于 2016-06-28 05:01:24

答案是创建帖子的翻译版本。我不知道它还没有完成,这是我第一次使用WPML。该插件将语言类别添加到查询的帖子中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38058638

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档