Title: [Plugin: WordPress Popular Posts] Shortcode not working
Last modified: August 19, 2016

---

# [Plugin: WordPress Popular Posts] Shortcode not working

 *  Resolved [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/)
 * This plugin really rocks! We merged the views from the Lesterchan post views 
   plugin with the WordPress Popular Plugin because now we can sort the most viewed
   posts in different time ranges. We also wrote an additional plugin to let our
   users sort the posts on the category pages by ‘most viewed posts’ in an certain
   time range..
 * I tested this on a mirror of my blog and everything works fine. However on my
   current blog the shortcode is not working. I managed to do it with: `echo do_shortcode('[
   wpp range=today limit=7 pages=0 stats_views=0 stats_comments=0 order_by=views
   wpp_start=<ul> wpp_end=</ul>]');` but the shortcode `get_mostpopular("range=daily&
   limit=7&stats_comments=0&pages=0&post_start=<li>");` doesn’t display the correct
   posts.
 * Any idea why the shortcode is not working? The database tables seems fine and
   the posts stats display the correct posts.
 * [http://wordpress.org/extend/plugins/wordpress-popular-posts/](http://wordpress.org/extend/plugins/wordpress-popular-posts/)

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

 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580867)
 * Hi jorisdieben,
 * There’s one slight mistake on your code:
 * `do_shortcode('[wpp range=today limit=7 pages=0 stats_views=0 stats_comments=
   0 order_by=views wpp_start=<ul> wpp_end=</ul>]');`
 * … should be:
 * `do_shortcode('[wpp range=daily limit=7 pages=0 stats_views=0 stats_comments=
   0 order_by=views wpp_start=<ul> wpp_end=</ul>]');`
 * There’s no ‘today’ value for the _range_ attribute. It should be either _daily_,
   _weekly_, _monthly_ or _all_.
 *  Thread Starter [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580904)
 * Of course thanks. But do you have any idea why only the ‘echo do_shortcode’ function
   is working and not the ‘get_mostpopular’ function? Maybe this explains why the
   sorting function on the category pages is not working ([http://bit.ly/95PI2y](http://bit.ly/95PI2y))
   too? I am using the newest updates of everything btw.
 * Ps. If anyone need a script to merge the ‘WP Lesterchan Views’ with the ‘wordpress
   popular plugin’. I would be happy to share it..
 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580918)
 * Actually, what the get_mostpopular function does is call the shortcode function:
 *     ```
       function wpp_get_mostpopular($args = NULL) {
   
       	if (is_null($args)) {
       		echo do_shortcode('[wpp]');
       	} else {
       		$atts = trim(str_replace("&", " ", $args));
       		echo do_shortcode('[wpp '.$atts.']');
       	}
       }
       ```
   
 * Anyways, I feel like I’m not following here. Can you please elaborate more on
   your problem?
 * **P.S.:** just updated my plugin to version 2.1.1, right now you’re using 2.1.0
   😉
 *  Thread Starter [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580952)
 * Oke, well somehow the get_mostpopular function doesn’t display the correct posts,
   but when I use the shortcode directly it does display the correct posts.
 * I thought maybe this small bug could explain why the additional plugin I wrote,
   is not working.
 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580963)
 * Have you tried using **wpp_get_mostpopular** instead?
 *  Thread Starter [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1580968)
 * Yes I did. I will have someone have an extra look into it and inform you if I
   know more. Thanks so far.
 *  [wildbug](https://wordpress.org/support/users/wildbug/)
 * (@wildbug)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1581268)
 * jorisdieben, I would love to merge the views from the [WP-PostViews](http://lesterchan.net/portfolio/programming/php/#wp-postviews)
   plugin that I am using but I am not a programmer. Is there an easy way to do 
   this that you can share with me? Otherwise the views are not accurate at all.
   Thanks!
 *  [edwardnh](https://wordpress.org/support/users/edwardnh/)
 * (@edwardnh)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1581301)
 * jorisdieben, I would love to get the script to merge the ‘WP Lesterchan Views’
   with the ‘wordpress popular plugin’ because I am moving my post views counter
   to wpp now and phasing out WP-PostViews.
 * How can you contact me to share?
 *  Thread Starter [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1581329)
 * Sorry guys forgot to subscribe to the folluwup’s. If you are still interested
   in the merge script please contact me here: [http://www.itelevision.nl/contact/](http://www.itelevision.nl/contact/)
 *  Thread Starter [Joris](https://wordpress.org/support/users/jorisdieben/)
 * (@jorisdieben)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1581330)
 * Btw of course it will be free of charge!

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

The topic ‘[Plugin: WordPress Popular Posts] Shortcode not working’ 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/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 10 replies
 * 4 participants
 * Last reply from: [Joris](https://wordpress.org/support/users/jorisdieben/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-shortcode-not-working/#post-1581330)
 * Status: resolved