My first WordPress plugin. You can see it in action right above this post under the header image. No, really. Hit refresh. It does exactly what you’d expect: Display a single, random post from your WordPress database.
I added a bit of code around it to jazz it up, which I plan to incorporate into the 1.1 version, if anybody even shows an interest in the 1.0 version.
Revision 1.02: Removed a blank line that was causing RSS feeds to break.
Download wp-single-random-post.zip
README FILE:
=== Single Random Post ===
Contributors: dcostalis
Donate link: http://www.isthisablog.com/
Tags: random, posts
Requires at least: 2.0
Tested up to: 2.7.1
Stable tag: 1.02
This plugin will allow you to display a single post selected at random from your post database
== Description ==
This plugin will allow you to display a single post selected at random from your post database
There are no bells and no whistles.
== Installation ==
1. Upload `single-random-post.php` to the `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Place `<?php single_random_post(); ?>` in your templates
== Frequently Asked Questions ==
= Why does this even exist? =
Because I had a use for it, and nobody else had made it yet
= Why doesn’t it do more? =
Because there are plenty of plugins that do a lot more, but none that do this little without editing
Download wp-single-random-post.zip
First of all thank you for this puglin that perfectly fits what I want on my site, unfortunately on some billet title that appears contains html characters like “& 830″ I can not correct the problem by myself, can you help me?
Sorry for my English …
I’m not sure what kind of issue you’re having, I’m sorry. From what I can tell, it sounds like certain characters aren’t displaying correctly on your blog, but I have checked the code a number of times, and it shouldn’t have that problem. Do you think you can send a link to show me where you are having this problem? I hope I am clear enough, language can be a hard barrier on the internet!
I thank you for responding so quickly, however I found an alternative for my needs with another plugin that displays a configurable number of post.
This seems to fit even better in my usage.
Thank you again
kakushins last blog post..Fleur violette
Pingback: Eklenti.Net > Wordpress Eklentileri » Single Random Post
How can I show the random post without the user clicking the title?
I just want them to click on my page called Random Post and have it bring up a page that simply shows a random post.
Currently it brings up a page that shows a random title and only upon clicking it does it reveal the random post.
Thank you
This plugin is just what I wanted, thank you! I was surprised there weren’t any other plugins that are as simple as yours. (and updated for wp 2.7)
Could you please explain where exactly I’d place ?
Sorry for n00bie, I’ not IT-man, and week ago I couldn’t ever imagine that I’ll build my site!
Pingback: BasicBlogger.de
I’d love to hear if there is an answer to Zach’s question of displaying the post content instead of just a link to the post.
Pretty please?
@Zach
@Viscouse
Doing this would end up rewriting the loop, or creating an entirely new plugin.
For those that are a bit savvy, you could take the code in this plugin, and use it to set the current $post->ID. You’d have to completely rewrite the rest of the code though.
Maybe I’ll find the time to write the plugin for it, if I don’t find one already out there!
@zach Hey, I found a plugin to do what you’re looking for. Random Redirect. Then just add /?random to the link. Enjoy.