Title: wp_get_attachment_image_src Array Not Working
Last modified: August 19, 2016

---

# wp_get_attachment_image_src Array Not Working

 *  [akabin](https://wordpress.org/support/users/akabin/)
 * (@akabin)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_get_attachment_image_src-array-not-working/)
 * In the Function Reference for wp_get_attachment_image_src it says you can use
   an array to pull a specific size of a thumbnail. I’ve tried everything I can 
   think of but can’t get it to pull the size specified by the array. Here is my
   code:
 * `$src = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), array(160,90));`
 * It defaults to the thumbnail I’m assuming since the array isn’t recognized. Suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [akabin](https://wordpress.org/support/users/akabin/)
 * (@akabin)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_get_attachment_image_src-array-not-working/#post-1711056)
 * Still trying to figure this out. Any suggestions?
 *  [_rg_](https://wordpress.org/support/users/arriba/)
 * (@arriba)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_get_attachment_image_src-array-not-working/#post-1711195)
 * try with wp_get_attachment_image(), i know, it will not give you the src, but
   the entire img tag…. but works.
 *  Thread Starter [akabin](https://wordpress.org/support/users/akabin/)
 * (@akabin)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/wp_get_attachment_image_src-array-not-working/#post-1711197)
 * Unfortunately it’s going in the meta data, so I need it without the img tag. 
   That then puts the image at the top of my WordPress page. I’m just really curious
   why the array isn’t working actually. That’s the correct format for an array 
   in .php right? Or is it array[160,90]?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_get_attachment_image_src Array Not Working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [akabin](https://wordpress.org/support/users/akabin/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/wp_get_attachment_image_src-array-not-working/#post-1711197)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
