• Resolved Joris

    (@jorisdieben)


    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/

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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

    (@jorisdieben)

    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) 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..

    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

    (@jorisdieben)

    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.

    Have you tried using wpp_get_mostpopular instead?

    Thread Starter Joris

    (@jorisdieben)

    Yes I did. I will have someone have an extra look into it and inform you if I know more. Thanks so far.

    jorisdieben, I would love to merge the views from the 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!

    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

    (@jorisdieben)

    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/

    Thread Starter Joris

    (@jorisdieben)

    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.