WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Easy Random Posts

An easy to use WordPress function to add random posts to any theme.

How do I display the results?

Insert the following code into your WordPress theme files:

General results

Without passing any parameters, the plugin will return ten results or fewer depending on how many posts you have.

thisismyurl_easy_random_posts('count=10');

Altering the before and after values

By default the plugin wraps your code in list item (<li>) tags but you can specify how to format the results using the following code:

thisismyurl_easy_random_posts('before=<p>&after=</p>');

The Order

You can now change the order of the results using ASC, DESC or RAND to return the results in ascending, descending or random order of date published.

thisismyurl_easy_random_posts('order=ASC;');

Nofollow

You can set if the link is displayed as a nofollow link for SEO optimization using the new nofollow option.

thisismyurl_easy_random_posts('nofollow=true;');

Echo vs. Return

Finally, if you'd like to copy the results into a variable you can return the results as follows:

thisismyurl_easy_random_posts('show=false');

Requires: 2.8.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-7-6
Downloads: 32,786

Ratings

4 stars
4.1 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
100,2,2