title: I want to show the subcategories in alphabetical order in Wordpress
body: <p>This is the code that I am using:</p>
  
  
  
  <p> //here main categories are shown</p>
  
  <p>
  
  <pre><code>      $w=mysql_query("select * from wp_term_relationships where term_taxonomy_id='$xresult[term_id]' "); //
  
        while( $wresult=mysql_fetch_array($w)) 
  
        {
  
       // at here i want that the list will be shown in alphabetic order
  
  
        $po=mysql_query("select * from wp_posts where ID='$wresult[object_id]' and post_status='publish' "); 
  
        $pod=mysql_fetch_array($po);
  
        $qq=mysql_query("select * from wp_postmeta where post_id='$pod[ID]' and meta_key='phone'");
  
        $q=mysql_fetch_array($qq);
  
  
            ?&gt;
  &lt;li&gt;
  
  &lt;a class="col-xs-6" href="&lt;?php echo home_url();?&gt;/store/&lt;?php echo $pod['post_name']; ?&gt;/"&gt;&lt;p&gt;&lt;?php echo $pod['post_title']; ?&gt;&lt;/p&gt;&lt;/a&gt;
  
  &lt;span class="col-xs-6"&gt;&lt;?php echo $q['meta_value'];?&gt;&lt;/span&gt;
  </code></pre>
  
  <p>Please help me. 
  Thanks in advance.</p>