How to Output Images from FileBird Folder WordPress
You can use the FileBird plugin to sort your WordPress media library images
<?php
/* Get a list of all folders with their ids created by the FileBird plugin */
$folders = FileBird\Model\Folder::allFolders();
var_dump($folders);
$images = [];
/* Function that displays the ids of images (attachments) by folder */
$items = FileBird\Classes\Helpers::getAttachmentIdsByFolderId(4);
$items = array_reverse($items,true);
//Output of the items array where 4 are the id of the folder, and 1627 are the id of the image in the library
/*
[11]=>string(4) "1783"
[10]=>string(4) "1782"
....
*/
foreach ($items as $key => $item):
/*Display images from folder with id 4*/
/*How to find out the id of a folder in the media library, see Fig. 2 below*/
$images[$key]['thumb'] = wp_get_attachment_image_url( $key , 'thumbnail' );
$images[$key]['medium'] = wp_get_attachment_image_url( $key , 'medium' );
$images[$key]['full'] = wp_get_attachment_image_url( $key , 'large' );
endforeach;
?>
<?php //Display images ?>
<?php foreach ($images as $image): ?>
<img src="<?php echo $image['medium']; ?>" >
<?php endforeach; ?>