WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] [Plugin: WordPress Popular Posts] Shortcode not working (11 posts)

  1. Joris
    Member
    Posted 4 years ago #

    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/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 4 years ago #

    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.

  3. Joris
    Member
    Posted 4 years ago #

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

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 4 years ago #

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

  5. Joris
    Member
    Posted 4 years ago #

    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.

  6. Héctor Cabrera
    Member
    Plugin Author

    Posted 4 years ago #

    Have you tried using wpp_get_mostpopular instead?

  7. Joris
    Member
    Posted 4 years ago #

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

  8. wildbug
    Member
    Posted 4 years ago #

    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!

  9. edwardnh
    Member
    Posted 3 years ago #

    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?

  10. Joris
    Member
    Posted 3 years ago #

    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/

  11. Joris
    Member
    Posted 3 years ago #

    Btw of course it will be free of charge!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic