Using URL variables on a custom WP_Query

WordPress doesn’t handle this logic qutomatically so you will have do do it manually.

What you need to do is:

  1. Read the url parameter with get_query_var( ‘category_name’ );

  2. injects it in your custom WP_Query:

     $custom_query_args = array(
         'post_type' => 'post',
         'tax_query' => array(
             'relation' => 'AND',
             array(
                 'taxonomy' => 'post_format',
                  'field'    => 'slug',
                  'terms'    => array( 'post-format-audio' ),
              ),
             array(
                 'taxonomy' => 'category',
                  'field'    => 'slug',
                  'terms'    => get_query_var( 'category_name' ),
              )
          )
     );
    

Note that if you decide to pass an arbitrary variable instead of category_name, you will need to declare it before using it.

See https://developer.wordpress.org/reference/functions/get_query_var/