WordPress loading all local images from specific directory?
get_stylesheet_directory was necessary for the glob function to work, you need a combination of both, e.g. fetch the files in that directory: $imagePath = get_stylesheet_directory() . “/IMAGES/sponsors/”; $filesList = glob( $imagePath . ‘*.{JPG,jpg,PNG,png}’, GLOB_BRACE ); and display the files at that URL: $imagePathURL = get_stylesheet_directory_uri() . “/IMAGES/sponsors/”; … echo ‘<img src=”‘ . esc_url( $imagePathURL . … Read more