title: Custom query: sort custom-post-type archive by title
body: <p>I'm trying to sort posts by title (instead of date) within a custom post type archive in Elementor. I've set up a custom query and trying to target the custom post type 'glossary' but I'm doing something wrong... can anyone help?</p>
  <pre><code>    add_action( 'pre_get_posts', 'glossary_sort_order'); 
          function glossary_sort_order($query){
              if(is_post_type_archive( $post_type, 'glossary', true )):
              $query-&gt;set( 'order', 'ASC' );
              $query-&gt;set( 'orderby', 'title' );
              endif;    
          };
  </code></pre>
  <p>Thank you</p>