Open benvoynick opened 10 months ago
Nice work. I've made some change in the main.php so you can put an array of extension instead and load jpg,png and webp.
` $extensions = ['jpg', 'png', 'webp'];
// Loop through each extension to check if the image exists
foreach ( $extensions as $ext ) {
$image_path = get_stylesheet_directory() . '/' . $path . '/' . $layout . '.' . $ext;
$image_uri = get_stylesheet_directory_uri() . '/' . $path . '/' . $layout . '.' . $ext;
// Check if the image exists for the current extension
if ( is_file( $image_path ) ) {
return $image_uri;
}
}`
This PR adds a hook to change the file format expected by the plugin in its search for images. This can address issue #19 as well as any other format someone would care to use for a site.