Network Latest Posts
[resolved] Randomize posts (3 posts)

  1. snapalot
    Posted 3 years ago #


    The specification for my client's site is to display 3 random posts (not older than 2 days) from six different blogs on the network in a widget. Every post should display the post's category name, thumbnail, post title and permalink.

    How do I randomise the posts? Will the requirement above place a huge load on the server? (The site has more than 8000 visits per day.)

    Great work with the plugin!



  2. Jose Luis SAYAGO
    Plugin Author

    Posted 3 years ago #

    Hello Kobus,

    Thanks for your comments. Well pull random posts wasn't possible till version 3.1.3 (recently pushed to the repository). I thought it was a good idea so I added a new parameter called random which receives two values: true or false (false by default so you don't need to specify it if you're not going to use it).

    It was somewhat easy to implement because the hook used to pass arguments to the query accepts orderding parameters.

    If you want to pull 3 random posts from six different blogs then you could use something like:

    [nlposts number_posts=3 title_only=false blog_id=1,2,3,4,5,6 thumbnail=true random=true]

    Version 3.1.3 should be available in a minute or so, until then you can see an example of the new parameter running here: Random Posts

    Let me know if it works as expected.


  3. snapalot
    Posted 3 years ago #

    Great, thank you Jose

    I've upgraded and will test.

    Keep well!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Network Latest Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic