Support » Plugin: Post Rotation » Rotation and language

  • Resolved roberto9911


    Hi, I tried yesterday your pluging and it’ s easy and works perfectly, but I have a multilanguage site, so should be nice if I can rotate the older post for each language, not only the only one.
    I use Polylang: do you think there is a way to rotate post in this way? in other words, as I have the same post into 4 languages, I like to rotate 4 post esch time, the older for each language. Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author digitalemphasis


    I’m very sorry, but adding support for a specific plugin as Polylang is not covered, at least for now.

    Hi, Thank u!
    I wait when you have time 🙂

    But… looking for a solution and leaning better how WP and pluging work (but i’m totally not expert of php!) I found a query on Polylang site.

    for french language
    $posts = get_posts( array(
    ‘post_type’ => ‘post’,
    ‘lang’ => ‘fr’, // use language slug in the query
    ‘showposts’ => 5,
    ) );

    for French and Germany
    $posts = get_posts( array(
    ‘post_type’ => ‘post’,
    ‘lang’ => ‘de,fr’, // query German and French posts
    ‘showposts’ => 5,
    ) );

    It seems to me similar to the one you use on your .php codes with one more param ‘lang’

    I can suppose it should be inserted in $query_args …
    Of course probably it’s necessary to extract the languages of the site (foreach…) and then the post inside each language with your…
    foreach ( $query as $value ) {
    $located = $value;

    All the best! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rotation and language’ is closed to new replies.