lundi 27 juin 2016

WPML Query_posts

I have a client who has an issue with WPML and query_posts();

The posts show up in the default language, but not in the Spanish version of the site.

It shows the fallback 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>

I've tried adding 'suppress_filters' => 0, to the array, but that did not remedy the solution.

Thanks for any assistance!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire