Getting the ID of any image for use in functions.php
Hopefully this helps, function mat_image_credit() { global $post; $args = array( ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ); $imgs = get_posts($args); foreach ($imgs as $img) { $field1 = slt_cf_field_value(‘flickr_credit’, ‘attachment’, $img->ID); $field2 = slt_cf_field_value(‘custom_credit’, ‘attachment’, $img->ID); if (!empty ( $field1 ) ) { echo ‘Image by ‘ . $field1; … Read more