3

I am using the Polylang plugin and noticed that I cannot display a post simultaneously in all languages. that's why I wondered is there a way to display posts from all languages on the site in a specific place well, or create a separate language where posts from all languages of the site would be displayed

I have to do this so that it works separately from other versions -is -en they would work as usual

but somewhere on the page [multilanguage news] or in versions -full all posts created on different versions of the site would be displayed

1 Answer 1

8

You need something like:

$args = array(
    'post_type' => 'post',
    'lang' => '', // no language specified
);

$posts = get_posts( $args );

if ( $posts ) {
    foreach ( $posts as $post ) :
        //do whatever
    endforeach; 
    wp_reset_postdata();
}

This would get you all the posts from all languages, you can add more args to the array if needed ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.