$arch_files = scandir($path); $items = []; foreach ($arch_files as $arch_file) { $time = \filectime($arch_file); $items[$time] = $arch_file; } ksort($items);
foreach($items as $item) {
if($item != "." AND $item != "..") {
if (is_file($path . $item)) {
$ext = getExtension($item);
switch ($ext) {
case 'mp3': echo wp_video_shortcode( ['src' => VA_URL.basename($path).'/'. $item,'height' => 400,'width' => 600,] ); break;
case 'jpg': echo '<p><img src="'.VA_URL.basename($path).'/'. $item . '"/>'; break;
default: echo '<p><a target="blank" href="'.VA_URL.basename($path).'/'. $item.'"> - '. $item . '</a></p>'; break;
}
}
else { echo "<b>" . $item ."</b><br>"; listIt($path . $item . "/");echo'<hr width="40%"/>'; }
}
}
$category_ = get_the_category($single->ID);
$lcp_thumbnail .= get_the_post_thumbnail( $single->ID, $lcp_thumb_size,array( 'alt' => esc_attr($single->post_title), 'class' => $category_[0]->slug));