I am trying to get an specific image of a post (they are added as gallery).
The thing is that I tried this 2 things:
$image = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
This works fine but it is bringing me all the images. So I added the arg "post_title" with my image title, but it still brings me all the images.
Later on I tried with wp_query:
$image = new WP_Query( array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image/png', 'post_title' => 'title' ) );
But this is not working neither.
It can't be so difficult, I want an specific image of a post by title...
Can somebody give me a hint?
Thanks in advance.