• Resolved daricedotorg

    (@daricedotorg)


    Since the latest plugin update (6.0.2,), the query is not working correctly. I’m running WordPress 6, PHP 7.4.4

    I have been using this code with no issues at all for years until the latest update. Now it outputs the HTML twice. The first output is without the CSS styling I assigned it and the second output is correct. Obviously, it should only output once.

    if ( function_exists('wpp_get_mostpopular') ) {
        wpp_get_mostpopular(array(
            'post_html' => '
               <h3><a href="{url}">{text_title}</a></h3>
               <p>{summary}</p>
                <a href="{url}" class=\'read_more\'> Read more
                <span class=\'screenreader-visible\'> about {text_title}</span></a>',
                'post_type' => 'post',
                'range' => 'last7days',
                'freshness' => 1,
                'order_by' => 'views per day',
                'limit' => 3,
                'excerpt_format' => 0,
                'excerpt_length' => 140
        ));
    }

    I cleared the cache, but still has the same issue.

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

    (@hcabrera)

    Hi @daricedotorg,

    So I just tried your code on a test WP site with the Twenty Twenty One theme and couldn’t reproduce the issue you reported. The popular posts list is being rendered only once as expected.

    Screenshot of popular post list being rendered only once when using OP's code as-is

    Anything else I should try to reproduce the problem?

    By the way, ‘views per day’ is not a valid order_by option ?? The order_by parameter accepts the following values: ‘comments’, ‘views’ (default), or ‘avg’ (see Parameters).

    • This reply was modified 2 years, 8 months ago by Hector Cabrera. Reason: Fixed typo
    Thread Starter daricedotorg

    (@daricedotorg)

    Sorry for the very late answer. Life happened and I was away from work.

    The problem is solved it was this that was breaking it after the update:

    “By the way, ‘views per day’ is not a valid order_by option ?? The order_by parameter accepts the following values: ‘comments’, ‘views’ (default), or ‘avg’ (see Parameters).”

    I changed the ‘order_by’ to ‘avg’ and it works fine now.

    Thanks!

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