How to pull image automatically?
-
I can pull an image on to a page using the id: (for 7 in this case)
// image id is stored as term meta $image_id = get_term_meta( 7, 'image', true ); // image data stored in array, second argument is which image size to retrieve $image_data = wp_get_attachment_image_src( $image_id, 'full' ); // image url is the first item in the array (aka 0) $image = $image_data[0];
But how would I write it so that the proper image would appear for each item in the “for each” loop?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to pull image automatically?’ is closed to new replies.