Code $args = array("post_type" => "mytype", "s" => $title); $query = get_posts( $args );
$posts = get_posts([ 'post_type' => 'recipe', 'title' => 'Chili Sin Carne', ]);