$args = array(
'post_type' => 'attachment',
'post_mime_type' =>'image',
'post_status' => 'inherit',
'post_title' => $name,
'posts_per_page' => 1
);
$query_images = new WP_Query( $args );
$images = array();
foreach ( $query_images->posts as $image) {
$images[]= $image->guid;
}
return $images;
I currently have this but it is not working for me. It prints out an image but not the image I wanted.
Yeah dynamically pull an image. Using image name. Is that possible?
Hi! What I mean is querying a specific image from the media library.