Query the title of the page to show posts with matching category in the loop September 23, 2022 by Tarik Billa you don’t need to echo the title out. Try this: $the_query = new WP_Query( array( 'category_name' => get_the_title() );