I have a Wordpress site translated from dansk to english using WPML. In it, I have a page which uses a custom page template to display the titles of all the posts. Sadly, it's displaying all posts twice: the original, and the translated.
This is the code I have:
<ul id="archive-list">
<?php $args = array(
'lang' => ICL_LANGUAGE_CODE,
'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>
Does anyone have any idea what I need to do to get this page to display only the titles in the current language?