Support » Plugin: WordPress Popular Posts » popular items list vanishes & returns

  • Hi Hector, I am having a problem with Popular Posts after it has worked perfectly for several years. Now a few popular items show up on my home page, change a bit, then in a few days “Sorry. No data so far” then a few posts come up again and it starts all over.

    I have the code for this plugin on the template for my home page. Here is the code:

    <?php
    
        if (function_exists('wpp_get_mostpopular'))
    
            wpp_get_mostpopular("
    
            limit=8&   // max number of posts displayed
    
            freshness=1&  // on/off get popular entries in time range
    
            order_by=views&  // high-lo order by
    
            stats_views=0&  // on/off number of views
    
            thumbnail_width=70&  //sets pixel width for thumbnails
    
            thumbnail_height=70&  //sets pixel height for thumbnails
    
            pid='-190,-336'&  // exclude from list by ID(s) #
    
            post_type=post,page,pig_poet,pig_artist //Defines the type of posts
    
            ");
    
    ?>

    Other than routine plugin updates I have made few site changes to the code anywhere on the site in over a year. I do have a catching plugin – Comet Cache. I have the most current version of WP and your plugin. Also on the plugin’s Stats screen it shows a top 12 of post/pages that seems correct and perfectly in accord with what I believe are the actual popular pages. I just need to get them onto my Homepage?

    Any help would be appreciated. Thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi there, it’s been a while!

    I do have a catching plugin – Comet Cache.

    WordPress Popular Posts can work with caching plugins, but since you’re not using the widget you’ll need to code some AJAX to prevent Comet cache (or any other caching plugin) from caching the popular posts lists (otherwise it won’t be updated until the very next time the cache gets rebuilt again.)

    So, your first action should be to convert that PHP block into a div (or any other HTML container element you prefer) that gets dynamically populated with posts via AJAX, then you’ll need to clear Comet’s cache so your site picks up this change.

    If all of the above sounded like ancient valyrian to you, you may need to hire someone to help you implement this (and in case you’re interested, I’m available for freelance jobs).

    For a couple of additional observations/suggestions you’ll want to read this as well: Is WordPress Popular Posts compatible with caching plugins?

    Thread Starter Dano at Porkopolis

    (@porkopolis)

    Hi Hector, glad to hear you’re fluent in ancient Valerian, as for me, well, I drink, and I know things… 🙂

    Thanks for the reply above, but I did some more investigating and have an alternative answer that seems to be working.

    I went to your “2. Template tags” page at https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#wpp_get_mostpopular

    I copied your original code:

    <?php
    
        if (function_exists('wpp_get_mostpopular'))
            wpp_get_mostpopular();
    
    ?>

    Then I updated and saved my home page and refreshed it in my browser and a basic list appeared!

    I proceeded to add parameters one at a time without using the comments and extra returns I had in the original. I kept checking the page after each parameter was added. I changed a few parameters and finally ended up with this:

    <?php
    
        if (function_exists('wpp_get_mostpopular'))
            wpp_get_mostpopular("post_type=post,page,pig_poet,pig_artist&thumbnail_height=70&thumbnail_width=70&stats_views=0&pid='-190,-336'&order_by=views&limit=8&range=all");
    
    ?>

    This all works. Yea!

    Not sure at all what the problem actually was – the comments, line returns, the order of the parameters, ? – but maybe this is correct now. I’m going to give it a whirl for awhile (fingers crossed).

    Thanks for the support!
    Dano

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘popular items list vanishes & returns’ is closed to new replies.