jacquesleb
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Please i’m really desperate for a solution to this urgently!
Ok I’ve been staring at this for hours and I still don’t get it?
The solution present is about getting all the different images and displaying specific ones with ajax, I don’t want that, I just want to get all images from one folder with php, why is there no documentation on this at all?
global $wpdb; $query = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}fbv"); $folders = $wpdb->get_results($query);So that gets every folder but I only want get images from the folder “Gallery” which has an ID of “4”.
$query = $wpdb->prepare("SELECT attachment_id FROM {$wpdb->prefix}fbv_attachment_folder"); $all_folders_ids = $wpdb->get_col($query); $image_args = array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'posts_per_page' => -1, 'orderby' => 'rand', 'post__in' => $all_folders_ids ); $all_images = new \WP_Query($image_args);This didn’t help either as this just gets every single image, and I have no idea how to only get images from the gallery folder, please I desperately need to get this fixed this week.
folder has string of “Gallery” with ID of “4”, i just need the image url and alt for those.
Viewing 2 replies - 1 through 2 (of 2 total)