0

I use the Polylang plugin to translate my website in Italian and German. How can I get the latest post in Italian?

I'm using the arguments below to get the content of the post, which afterwards I send via newsletter, but I don't know how to get the right language.

$args_menu = array (
    'post_type' => 'EXAMPLE',
    'order'=> 'DESC', 
    'paged' => $paged, 
    'post_status' => 'publish',
    'posts_per_page' => 1, 
    'suppress_filters' => false  
);

1 Answer 1

5

If you use the query_post function, I think you can just add the 'lang' parameter:

$args_menu = array (
   ...
   'lang' => 'it',
   ...
);

See : http://wp.primacom.cz/en/enplugins/how-to-display-posts-only-in-one-language-in-polylang-plugin/

2
  • You are a genius!!! lol... This is exactly what i need, thank you!
    – lacepace
    Commented Feb 15, 2016 at 12:34
  • Glad it worked! Don't forget to mark this as solved ;) Regards Commented Feb 15, 2016 at 14:44

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.