help plugin WP random posts display image ?

Status
Not open for further replies.
5 comments
I coded a simple one to use into my blog, but it uses timthumb, anyways can be modified very easily to not use timthumb. The plugin is not coded in very proffesional way but do the job.
Check my site http://www.userpornx.com
Check one post ("what others are viewing") and if you are searching something like the plugin that i coded, i will share with you without problems.
 
I am using this (a bit modified version) with the combination of "get the image" plugin and it works fine for me. Try it.

Note: I am not the coder, credit goes to the one who wrote metube theme.

Code:
<div class="randomposts">
			
				<h2>Random posts</h2>
				<?php $recent = new WP_Query("cat=-YOUR_CAT_ID>&showposts=12&orderby=rand"); while($recent->have_posts()) : $recent->the_post();?>
					<div class="posts">
						<div class="postimage">
							<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php if ( function_exists( 'get_the_image' ) ) get_the_image( array( 'meta_key' => 'timethumb', 'size' => 'medium', 'width' => '120', 'height' => '72', 'image_class' => 'feature' ) ); ?></a>
						</div>
					</div>
				<?php endwhile; ?>
			
			</div>
			
			<div class="randomposts">
 
Status
Not open for further replies.
Back
Top