• Resolved icakeov

    (@itucakov)


    Hello
    I am looking for a plugin to track popular posts and I am currently also using the Polylang plugin to have different language websites.
    Because of this, with the most popular post plugin I will need to call the polylang custom taxonomy, for example “lang=en” in order to display only the english posts.
    Do you guys have a way of working with all this?
    Suggestions and comments appreciated.

    https://wordpress.org/plugins/wp-postviews/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Lester Chan

    (@gamerz)

    I am not too sure how Polylang works, but the views should be agnostic unless you are talking about translating the word “views”. If that is the case than nope it does not support multiple languages because it is templated.

    An alternative is to go to WP-Admin -> Settings -> PostViews, removed the “views” word from the “Views Template”

    Then in your theme php page, you can call a <?php the_views(); ?><?php _e('views'); ?>

    Thread Starter icakeov

    (@itucakov)

    Thanks for the response Lester.
    Polylang basically doubles Posts. I started with english versions and then I created a spanish site with all the posts that is translated to spanish. They are distinguished by the “lang” taxonomy, so if I want to put up bunch of posts, I would just need to include that taxonomy in the array. For example:
    $args = array( 'numberposts' => 4, 'post_status'=>"publish", 'lang' => 'en', 'post_type'=>"post",'orderby'=>"post_date",'order'=> 'DESC','tag'=>"Feature",'category__not_in'=> array(19,27,454,1318)); // Social Calendar, Contests, Events
    This only displays english posts.
    If I wanted to do that for the most popular posts, I’d need to call your popular post function but I would want it to filter out for me only one language posts.

    Plugin Author Lester Chan

    (@gamerz)

    Add in the meta

    <?php query_posts( array( 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); ?>

    Thread Starter icakeov

    (@itucakov)

    Ah, that sounds like it would solve the problem!
    Is ‘meta_value_num’ the plugin’s variable or WP’s global variable?

    Plugin Author Lester Chan

    (@gamerz)

    Thread Starter icakeov

    (@itucakov)

    Very cool. You rock Lester, thanks!
    I was going to “resolve” it but I guess it’s not a directly a support question.

    Plugin Author Lester Chan

    (@gamerz)

    Thank you =)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘does this plugin support Polylang?’ is closed to new replies.