Easy Random Posts Plugin for WordPress
While I was working on my new theme for thisismyurl.com I came across the need to publish a series of random posts in the side bar and so I put together a simple post randomizer for WordPress. The tool works like most WordPress theme calls and features:
- Customizable number of links returned
- Customizable before and after to ensure you can display the results
- The ability to echo or return results
To use the plugin, install it to your WordPress website and edit your theme files by placing the following code:
General results
Without passing any parameters, the plugin will return ten results or fewer depending on how many posts you have.
[source lang="php"]<?php randomPosts();?>[/source]
Specific number of results
If you would like to return a specific number of results as your maximum:
[source lang="php"]<?php randomPosts(‘count=10′);?>[/source]
Echo vs. Return
Finally, if you’d like to copy the results into a variable you can return the results as follows:
[source lang="php"]<?php randomPosts(‘echo=false’);?> [/source]
Download
Support forums are now online! If you have any questions, please visit http://forums.thisismyurl.com.





