Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $post_amount = 5;
- $random_posts = get_posts('numberposts='.$post_amount.'&orderby=rand');
- foreach( $random_posts as $post ){
- setup_postdata($post);
- ?>
- <div>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- <div><?php the_excerpt(); ?></div>
- </div>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement