• Resolved riyazmuhammad

    (@riyazmuhammad)


    Hi,

    This is a nice plugin to show popular posts. I have recently made my blog multilingual by using Polylang plugin. I can see Popular posts plugin support with polylang. I am using below code to show popular posts on my blog.

    $argss = array(
        'post_html' => '<li class="popular-post"> {thumb} <h5><a href="{url}">{text_title}</a></h5></li> <div class="clearfix"></div>',
        'thumbnail_width' => 65,
        'thumbnail_height' => 65,
        'limit' => 5,
        'range' => 'weekly',
        'post_status' => 'publish'
    );
    
    wpp_get_mostpopular( $argss );

    May I know how to filter this for both languages? Also if translation not available for one of the popular post, will it show default language or another posts from current language. Let me please know.

    Thank you,

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey there,

    (…) if translation not available for one of the popular post, will it show default language (…)

    This is the expected behavior actually, and the same reason why it’s not possible to filter posts by language: WPP doesn’t keep separate data per language.

    Thread Starter riyazmuhammad

    (@riyazmuhammad)

    Thank you Hector for the reply. I understood your point.

    After some research I found that posts can filter by category. So I made two separate widget items for each language and filtered categories. Arabic page showing perfect but English is showing “Sorry no Data so far”. It means will it show after some views?
    Currently I don’t have English translations for any popular posts showing in Arabic.

    My question is why it is not showing any posts from english language categories?
    I mean can I strictly filter some categories and show the popular posts from remaining categories only?

    Please see the blog here

    Thank you,

    Plugin Author Hector Cabrera

    (@hcabrera)

    As I mentioned earlier, views data isn’t separated by language.

    This is what’s happening: let’s say you have two posts, A and B. A is in arabic and B is the english version of A.

    • If someone visits A, the plugin will increase its views count.
    • If someone visits B, the plugin will increase the views count of A because B is it’s translated version.

    WPP assumes that every post will have a translation (which is the original purpose of translation plugins such as Polylang and WPML), and so both A and B share the same views data.

    This is why what you’re trying to do (separate posts by language category) won’t work. You’ll have to translate your popular posts into english as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Polylang support’ is closed to new replies.