Skip to main content
added 4 characters in body
Source Link
Rob Vermeer
  • 5.2k
  • 2
  • 29
  • 21

For the language filter from WPML to take effect you have to allow filters in get_posts. Default this is off.

You can add suppress_filters=0 to your get_posts args and it should work. See: http://codex.wordpress.org/Template_Tags/get_posts#Parameters

<ul id="archive-list">
    <?php $args = array( 'suppress_filters' => 0false, 'numberposts' => '-1', 'post_type' => 'post', );
    $myposts = get_posts($args);
    foreach($myposts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
</ul>

For the language filter from WPML to take effect you have to allow filters in get_posts. Default this is off.

You can add suppress_filters=0 to your get_posts args and it should work. See: http://codex.wordpress.org/Template_Tags/get_posts#Parameters

<ul id="archive-list">
    <?php $args = array( 'suppress_filters' => 0, 'numberposts' => '-1', 'post_type' => 'post', );
    $myposts = get_posts($args);
    foreach($myposts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
</ul>

For the language filter from WPML to take effect you have to allow filters in get_posts. Default this is off.

You can add suppress_filters=0 to your get_posts args and it should work. See: http://codex.wordpress.org/Template_Tags/get_posts#Parameters

<ul id="archive-list">
    <?php $args = array( 'suppress_filters' => false, 'numberposts' => '-1', 'post_type' => 'post', );
    $myposts = get_posts($args);
    foreach($myposts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
</ul>
Source Link
Rob Vermeer
  • 5.2k
  • 2
  • 29
  • 21

For the language filter from WPML to take effect you have to allow filters in get_posts. Default this is off.

You can add suppress_filters=0 to your get_posts args and it should work. See: http://codex.wordpress.org/Template_Tags/get_posts#Parameters

<ul id="archive-list">
    <?php $args = array( 'suppress_filters' => 0, 'numberposts' => '-1', 'post_type' => 'post', );
    $myposts = get_posts($args);
    foreach($myposts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
</ul>