• Resolved Huanyi (Eric)

    (@no249a002)


    I try to embed the popular post list with the following PHP code, but posts in different languages are still mixed in the list as shown in the attached URL.

    I’m using Polylang Pro as my multi-language plugin and it’s updated to version (3.1.5) and the latest version of WordPress Popular Posts (6.0.4)

    $language = array(
    	'ja'     => 1502, //these are the term_id I found in the database
    	'zh_TW'  => 1504,
    	'en'     => 7623,
    );
    wpp_get_mostpopular( 
    	array(
    		'limit'           => 5,
    		'range'           => 'last7days',
    		'stats_views'     => 0,
    		'taxonomy'        => 'language',
    		'term_id'         => strval( $language[ get_locale() ] ),
    	)
    );

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

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

    (@hcabrera)

    Hi @no249a002,

    … but posts in different languages are still mixed in the list as shown in the attached URL.

    Yes, as noted on the Description page WordPress Popular Posts expects all posts to have a translation available. When no translations are found WPP will return the original article instead, hence what you’re seeing on your site.

    Polylang & WPML 3.2+ support – Show the translated version of your popular posts!

Viewing 1 replies (of 1 total)
  • The topic ‘The plugin doesn’t filter the posts by languages.’ is closed to new replies.