Random Post Box

Download Random Post Box from WordPress.org
See the plugin in use on Retrocamera.net (the little box below the first post).

Random Post Box is a WordPress plugin. It will let you place a box (div) anywhere on your blog, with templatetag or shortcode, and load random posts with an interval and fade effect. It uses jQuery (Ajax) which means that the content is loaded without loading the rest of the page. The timing can be controlled in the Admin Options-panel.

The template tag is <?php random_post_box(); ?>. You can also use the shortcode [random-post-box] in a page or post.

Features

  • Insert placeholder with template tag
  • Insert placeholder with shortcode
  • Set time for displaying the post
  • Set times for fade in and fade out affect
  • Exclude or include posts by category
  • Exclude posts by age (in days)
  • Use title only
  • Use post excerpt or bodycontent
  • Strip tags from body
  • Show/hide post metadata
  • Prepared for translation

Installation

The installation is like mosts plugins:

  1. Download and extract the files
  2. Upload `random-post-box` folder to the `/wp-content/plugins/` directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Place `<?php random_post_box(); ?>` in your templates, or [random-post-box] in a page or post.

The install doesn’t touch the database much, it just adds one option post.

Frequently Asked Questions

Is there an option to display several posts?
Not at the moment, but it might be included in future versions. It’s not recommended to use the
template tag several times on the same page.

How can I style the box?
The box is a div with id “random-post-box”, and the markup inside is quite similar to the
default theme.

The box changes size when loading a new post
You need to set the size to something static with CSS, or use some means to control the size. Use the id “random-post-box” as described
in the previous answer.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Live
  • Technorati
  • Twitter

12 Responses to “Random Post Box”

  1. Elizabeth says:

    This is a great plugin! Terrific idea as it will keep old posts alive on the website. I am, however, having trouble finding where to set the timings, etc. I am a WP rookie, so, I may be in front of my eyes, but, thought you would be able to help out.
    Thanks!!

  2. Mattias Wirf says:

    Thanks Elizabeth :) After activation, you should find the settings in the WordPress admin Options-panel, in the bottom left. The page is called Random Post Box.

  3. Cichlid says:

    My friend is using your plugin. I’m currently using a different plugin on my site but noticed a lot of inconsistencies. So this will work perfectly.

  4. Joe says:

    Hi Mattias,

    Really nice plugin, I’ve been looking for something like this for a while now and this is the best execution I’ve come across. I really like the rolling fade effect. (One strange thing, it wouldn’t work for me using the shortcode, I had to insert the template tag into the page using a php code plugin – no problem, its working great now). Thanks for all your efforts. Great job!

  5. Tom says:

    Great pugin. I was looking for something like this all day. It is very useful.

    Thank you ~ Tom

  6. Excellent plugin, but I do have one question:

    Is there any way to modify/duplicate the plugin so that I can place two different versions of the post box? I have two categories that I want to display in different places, but I need to have each location only display the category associated with that location.

  7. Kathy says:

    This plugin didn’t work for me. I have 3 posts in the category I told it to pull from, set the #days to 0 so it should have pulled them all. Nothing displayed (no code was generated at all).

  8. fallenboy says:

    Hey Mattias!

    It’s such a great plugin! Thanks. But unfortunately it doesnt play well with wordpress 3 :( It doesnt load content … Just to let you know :)

    All the best!

  9. Mattias Wirf says:

    Thanks, I know :) Well fix as soon as I get some time. Think it’s due to jquery version has changed in wp3.

  10. [...] The original post about the plugin &raqou; Share and Enjoy: [...]

  11. I like the look of this plugin, but unfortunately it’s just not working for me. Where the post should output, I just get ‘-1′ fading in and out. Pity really, as it’s exactly what I need.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">