• Resolved erh

    (@erh)


    Hi,

    I am currently using WP Popular Posts very happily on my site: http://www.practicalnetworking.net.

    The widget I have on the sidebar and footer displays the top 5 most popular posts per week. This is working exactly as I wanted it to.

    However, the effect I get is the popular posts get more attention, and prevent the unpopular posts from ever getting it to the top 5.

    I would like to set up another widget that displays 5 random articles… BUT, I would like for the random article to NOT list articles that already exist on the “top 5” widgets.

    Is something like this possible?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    Possible? Yes. With widgets? Not so sure.

    Problem is currently there’s no way to tell the WPP widget “hey, exclude this before you load” (that’s why there’s a Widgets section so you can configure them before they are loaded on the “front-end” of your site.)

    Let’s just pretend for a moment that it is possible to tell the WPP widget to exclude certain posts. If so, you still would need to find a way to retrieve the IDs of the posts from the “random” widget and pass them to the WPP widget.

    Sounds complicated, doesn’t it? 😛 Here’s what I would do:

    1. For the list of “random” posts, I would just use the WP_Query class (see example) and store the IDs of the random posts somewhere for later use.
    2. Then, I would use the wpp_get_mostpopular() template tag to list my popular posts, and pass it the IDs of the random posts I got on step 1 (string, comma separated!) using the pid parameter (see Settings > WordPress Popular Posts >
      Parameters
      for more.)

    Add salt and pepper to taste 😛

    Thread Starter erh

    (@erh)

    Yikes. That sounds complicated. Do you have any ideas that wouldn’t require development work / coding?

    -eh

    Plugin Author Hector Cabrera

    (@hcabrera)

    That’s precisely what I’ve tried to convey with my previous comment: what you’re trying to accomplish (having two third-party plugins / widget talk to each other) requires coding.

    Thread Starter erh

    (@erh)

    Noted, Hector. Thank you for the response. I may end up just putting two WPP widgets, one with top five and the other with random. The “risk of overlap” is only 5/<num of articles I’ve published>.

    Either way, thanks for your time and for making a great plugin!

    Thread Starter erh

    (@erh)

    err.. wait, I just played around with WPP… It doesn’t look like displaying five random posts is possible… Is it? Just posts sorted by top views / comments / views-per-day.

    -eh

    Plugin Author Hector Cabrera

    (@hcabrera)

    It doesn’t look like displaying five random posts is possible… Is it? Just posts sorted by top views / comments / views-per-day.

    That’s the expected behavior 😛 Why would a popular plugin show some random posts?

    Thread Starter erh

    (@erh)

    Maybe with the interpretation that it might make the posts popular 😉

    I know, I know, its a reach. Had to ask. Thanks either way, Hector, I appreciate the responsiveness!

    Don’t suppose its on the docket for a future version by chance, is it?

    -eh

    Plugin Author Hector Cabrera

    (@hcabrera)

    Nope, I honestly don’t think other users would find that useful. Plus there are many “random posts” widgets out there already 😛

    If you’re looking for a widget similar to WPP, you might want to try Recently. It’s a Recent Posts widget but _I think_ it’s possible to have it show random posts (need to look at the source code to be sure but it’s late over here and I’m really exhausted now. Wait, from the top of my head I believe someone asked about it already, I think it can be done. I’ll check tomorrow if you’re interested.)

    Thread Starter erh

    (@erh)

    No worries, Hector, thank you for your help. I’ll take a look at “Recently”. Please don’t feel you have to do any more work for this request, you’ve been very helpful / responsive as is.

    All the best!

    -eh

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

The topic ‘Five random posts widget… without overlap with popular posts widget’ is closed to new replies.