Support » Plugins » Need Random Post Plugin with Thumbnail

  • I am looking for a plugin that will show a list of random titles from various posts on my blog, along with a thumbnail picture next to the title corresponding to that particular post.

    I do believe I have seen this on a blog or two, but can’t remember where. Does ANYONE know of where I can find something like this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • DOES ANYONE HAVE ANY SUGGESTIONS????

    you need 2 things: postimages (to get the thumbnails), which I am just now working on for a client and have posted a solution here:
    http://wordpress.org/support/topic/151846

    And then there’s the random-post issue, which is pretty much real simple. Read up on multiple loops, template tags etc. This
    http://wordpress.org/support/topic/142029?replies=9
    will point you in the right direction.
    Basically, start a new loop anywhere in your template and insert a new query “setting” before that.

    <?php query_posts('showposts=999&random=true');?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<div>
    		<h1><?php the_title(); ?> (<?php the_time('j. F Y'); ?>)</h1>
    		<p><?php the_content(); ?></p>
    	</div>
    <?php endwhile; else: ?><p>Oops, no posts!</p><?php endif; ?>

    Mores,

    Thanks for your repsonse. Im glad someone could finally get back at me on this.

    I couldn’t get any of the random post code to work on the thread link you provided, BUT your code:

    <?php query_posts('showposts=999&random=true');?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<div>
    		<h1><?php the_title(); ?> (<?php the_time('j. F Y'); ?>)</h1>
    		<p><?php the_content(); ?></p>
    	</div>
    <?php endwhile; else: ?><p>Oops, no posts!</p><?php endif; ?>

    Worked fine…although it shows date, description, and other elements of the posts I don’t need. I am far from having programmer knowledge, but do know enough to manipulate and follow directions. Looking at your code there, can you let me know how to allow only the “title” and the “pic” to be viewable and nothing else? I would also need to resize the pic to because it is fairly large. Was looking at around 25X25 pixel thumbnail.

    First you need to create the functions.php file and add the code that I posted in that first link.

    Then you insert this bit where you want it:

    <?php query_posts('showposts=999&random=true');?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<div>
    		<h1><?php the_title(); ?></h1>
    		<p><?php postimage('thumbnail'); ?></p>
    	</div>
    <?php endwhile; else: ?><p>Oops, no posts!</p><?php endif; ?>

    Now this will give you the default wordpress thumbnail, which is 150xsomething I think.
    If you plan on always using 25×25, you might want to modify your wordpress settings accordingly. But since that attached posts function uses a predefined internal function called wp_get_attachment_image, I cannot tell you how to get a 25×25 miniature out of a regular uploaded image.

    Or you can use something like the Arkayne Plugin.

    Its not random though, it actually picks links base on similar content but I guess thats better than random. As far as thumbnails there may be a way you could modify the plugin…

    if there is a “order_by” feature in this plugin, you can probably get it to do random stuff by defining the sorting to be not “ASC” or “DESC” but “rand()”

    I think …

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need Random Post Plugin with Thumbnail’ is closed to new replies.