I am trying to figure out how to get the name of files in folder, but I can't seem to find a way to point to the right directory
$location = get_template_directory_uri();
$dir = $location.'/slider/images/';
$files2 = scandir($dir, 1);
print_r($files2) ;