Title: random post upon link
Last modified: February 5, 2017

---

# random post upon link

 *  [alicson](https://wordpress.org/support/users/alicson/)
 * (@alicson)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/random-post-upon-link/)
 * hi.. i see [Alex’s plugin](http://www.w-a-s-a-b-i.com/archives/2004/05/27/wordpress-random-posts-plugin/#comment-327)
   for random posts.. it looks really good.
    how can i use this such that you get
   random posts upon hitting a link? so the index page would reload (or load, if
   link had been clicked from an archive page) and have random posts in place of
   the originally-shown posts.. thanks in advance…

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mark Jaquith](https://wordpress.org/support/users/markjaquith/)
 * (@markjaquith)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/random-post-upon-link/#post-72715)
 * You could create a variable, maybe called “random_posts.”
    Create a link to [http://yoursite.com/?random_posts=true](http://yoursite.com/?random_posts=true)
   In your index.php file, you can check to see if random_posts is set like so: `
   <?php if ($_GET['random_posts']) {  showRandomPostsThingie(); } ?> obviously,
   you’d want to integrate this into the “if ($posts)” conditional, so that only
   the random posts would be shown. That should give you the general idea of how
   to do it.
 *  Thread Starter [alicson](https://wordpress.org/support/users/alicson/)
 * (@alicson)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/random-post-upon-link/#post-72729)
 * thank you for that, mark..
    i played around with your suggestion for a while..
   it looks completely correct and useful–if only i knew the proper syntax to make
   the rest of the wordpress php code mix in with it. but i guess i’ll learn/figure
   that out eventually… i’ve realized:
    -  i’m really going to have to learn php sooner than later to do what i’d like
      to do with wordpress
    - while Alex’s plugin is great, i’m looking for something that can reproduce
      the entire post–author and all… so probably something that can return an entire
      container/div-enclosed section/include of all the pieces that make up the 
      view of “one post” (author, permalink, date, title, content, comment-link,
      etc.)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘random post upon link’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [alicson](https://wordpress.org/support/users/alicson/)
 * Last activity: [21 years, 11 months ago](https://wordpress.org/support/topic/random-post-upon-link/#post-72729)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
