title: Wordpress disable pagination and limit number of posts
body: <p>I have a page on wordpress where i want to display 10 random posts. It is working using that code:</p>
  
  <pre><code>    &lt;?php if ( have_posts() ) : ?&gt;
  
              &lt;?php twentyeleven_content_nav( 'nav-above' ); ?&gt;
  
              &lt;?php /* Start the Loop */ 
              query_posts( 'orderby=rand&amp;posts_per_page=10' );
              ?&gt;
              &lt;?php while ( have_posts() ) : the_post(); ?&gt;
  
                  &lt;?php get_template_part( 'content', get_post_format() ); ?&gt;
  
              &lt;?php endwhile; ?&gt;
   [...]
  </code></pre>
  
  <p>I want to disable pagination on that page, if i disable it using <strong>nopaging=true</strong>, all posts will be displayed. How to set a limit while limiting the number of posts?</p>