Title: Randomize posts problem
Last modified: August 21, 2016

---

# Randomize posts problem

 *  [chokolademan](https://wordpress.org/support/users/chokolademan/)
 * (@chokolademan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/randomize-posts-problem/)
 * Hello, I have trouble randomizing my posts. I have googled all around and looked
   for plugins, but don’t know how to fix this.
 * I used to get this working with the following code:
 * _[please read [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
   for posting code]
 * `<?php query_posts($query_string . '&orderby=rand') ?>`
 * But with the theme I’m now using it won’t work, I don’t really know why…
 * The index.php shows this:
 *     ```
       <?php get_header(); ?>
       			<?php get_sidebar('top'); ?>
       			<?php
       			if (have_posts()) {
       				/* Display navigation to next/previous pages when applicable */
       				if (theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation')) {
       					theme_page_navigation();
       				}
       				/* Start the Loop */
       				while (have_posts()) {
       					the_post();
       					get_template_part('content', get_post_format());
       				}
       				/* Display navigation to next/previous pages when applicable */
       				if (theme_get_option('theme_bottom_posts_navigation')) {
       					theme_page_navigation();
       				}
       			} else {
       				theme_404_content();
       			}
       			?>
       			<?php get_sidebar('bottom'); ?>
       <?php get_footer(); ?>
       ```
   
 * What would be the best way to randomize it with this index.php
 * Many thanks!!

Viewing 1 replies (of 1 total)

 *  Thread Starter [chokolademan](https://wordpress.org/support/users/chokolademan/)
 * (@chokolademan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/randomize-posts-problem/#post-4614904)
 * Or could anyone point me to the right direction of a plugin to accomplish this?
   
   But a suggestion for the code is also still welcome 🙂

Viewing 1 replies (of 1 total)

The topic ‘Randomize posts problem’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [chokolademan](https://wordpress.org/support/users/chokolademan/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/randomize-posts-problem/#post-4614904)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
