title: Sort posts by name in Wordpress
body: <p>For some reason, no matter what I do, nothing seems to work to put these posts by alphabetical order. The code is:</p>
  
  <pre><code>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post();
  array( 'posts_per_page' =&gt; -1, 'orderby'=&gt; 'title', 'order' =&gt; 'ASC' ); 
   ?&gt;
  &lt;li&gt;
  &lt;div class="sponsor-thumb"&gt;
  &lt;a href="'.get_permalink().'"&gt;
  &lt;?php the_post_thumbnail( 'category-thumb' ); ?&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;a href="&lt;?php the_permalink() ?&gt;"&gt;
  &lt;?php the_title(); ?&gt;
  &lt;/a&gt;&lt;/li&gt;
  &lt;?php endwhile; else: ?&gt;
      &lt;p&gt;&lt;?php _e('Sorry, this page does not exist.'); ?&gt;&lt;/p&gt;
  &lt;?php endif; ?&gt;   
  </code></pre>