如何将类别参数添加到短代码?

I am trying to create a shortcode that displays my post type: advanced_topic but want to add the category parameter such as

[advanced-topics category="parole"]

to display only topics under that category.

This is the code I have so far but I feel like I'm missing something as it's not working... Any help is appreciated. Thank you.

function display_advanced_topics(){

    extract( shortcode_atts( array( 'category_name' => 'criminal-records' ), $args ) ); // $categoryName variable will be initialized to 'criminal-records' if the shortcode is missing the 'category' parameter

    $string = '';
    $args = array(
    'post_type' => 'advanced_topic',
    'posts_per_page' => -1,
    'post_status' => 'publish',
    'category_name' => $categoryName
    );

$query = new WP_Query( $args );
if( $query->have_posts() ){
    $string .= '<div class="advanced-topics">';
    while( $query->have_posts() ){
        $query->the_post();

        $string .= 
        '<div class="row advanced-topic">'
                    .'<div class="content">
                            <div class="title"><?php get_the_title(); ?></div>
                        </div>'
                .'</div>';
    }
            $string .= '</div>';

}
wp_reset_postdata();
return $string;
}
add_shortcode( 'advanced-topics', 'display_advanced_topics' );
  1. Always is good to use

        error_reporting(E_ALL);
        ini_set('display_error', 1);
    
  2. wrong quotes

        ob_start();
        get_the_title()
        $the_title = ob_get_clean();
        $string .= 
        '<div class="row advanced-topic">'
                    .'<div class="content">
                            <div class="title">'. $the_title .'</div>
                        </div>'
                .'</div>';
    

if get_the_title() prints results you must use ob_get_clean