View Single Post
Old 11-05-2011, 05:19 AM  
tonyparra
Confirmed User
 
tonyparra's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
Quote:
Originally Posted by tonyparra View Post
Ive been trying to add random post with thumbnail to a blog, but cant get it to work, cant find a plugin :

PHP Code:
<ul>
<?php
$args 
= array( 'numberposts' => 5'orderby' => 'rand''post_status' => 'publish''offset' => 0);
$rand_posts get_posts$args );
foreach( 
$rand_posts as $post ) : ?>
    <li><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2><p><img src="<?php echo 

get_post_meta($post->IDthumbnailtrue); ?>" width="100" height="100">
</p></li>
<?php endforeach; ?>
</ul>
it spits out only the latest post and repeats it 5 times what the hall am i doing wrong???
this one displays what i want but the permalink is all the same!! i fucking hate you right now wordpress
__________________

High Performance Vps $10 Linode
Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot
tonyparra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote