Title: Duplicate output
Last modified: July 12, 2022

---

# Duplicate output

 *  Resolved [daricedotorg](https://wordpress.org/support/users/daricedotorg/)
 * (@daricedotorg)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/duplicate-output/)
 * 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](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/duplicate-output/#post-15818258)
 * Hi [@daricedotorg](https://wordpress.org/support/users/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⌉⌊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](https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#parameters)).
    -  This reply was modified 3 years, 11 months ago by [Hector Cabrera](https://wordpress.org/support/users/hcabrera/).
      Reason: Fixed typo
 *  Thread Starter [daricedotorg](https://wordpress.org/support/users/daricedotorg/)
 * (@daricedotorg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/duplicate-output/#post-15958547)
 * 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.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [daricedotorg](https://wordpress.org/support/users/daricedotorg/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/duplicate-output/#post-15958547)
 * Status: resolved