Title: need wp_get_attachment_image_src
Last modified: August 31, 2016

---

# need wp_get_attachment_image_src

 *  Resolved [lschatzkin](https://wordpress.org/support/users/lschatzkin/)
 * (@lschatzkin)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/)
 * I found that I needed to include for the image to display after get_term_meta
   
   [http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src](http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src)
 * [https://wordpress.org/plugins/wp-term-images/](https://wordpress.org/plugins/wp-term-images/)

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

 *  [greta22](https://wordpress.org/support/users/greta22/)
 * (@greta22)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/#post-6959312)
 * Dear Ischatzkin,
 * Can you provide a code example ? I have been using
 * `echo '<img src="' . esc_url( wp_get_attachment_image_url( $image, 'small', true)).'"
   >';`
 * but i cannot change the image size to small or thumbnail. It always stay on full
   size.
 * thanks
 *  [scotcrop](https://wordpress.org/support/users/scotcrop/)
 * (@scotcrop)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/#post-6959400)
 * Try this :
 *     ```
       $image_id = get_term_meta( get_queried_object()->term_id, 'image', true );
   
       if ( ! empty( $image_id ) ) {
   
       	$image_atts = wp_get_attachment_image_src( $image_id, 'full' );
   
       	$image_url = $image_atts[0];
   
           	echo '<img src="' . esc_url( $image_atts[0] ) . '" />';
       }
       ```
   
 *  [greta22](https://wordpress.org/support/users/greta22/)
 * (@greta22)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/#post-6959403)
 * Thanks but that doesn’t work for me. I get this message :
 * Trying to get property of non-object in … on line 36
 *  Plugin Author [John James Jacoby](https://wordpress.org/support/users/johnjamesjacoby/)
 * (@johnjamesjacoby)
 * [10 years ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/#post-6959456)
 * I think a few people are having some similar issues, so I’ll be including helper
   functions in a future release to make this a bit easier to pull off theme-side.

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

The topic ‘need wp_get_attachment_image_src’ is closed to new replies.

 * ![](https://ps.w.org/wp-term-images/assets/icon-256x256.png?rev=1534007)
 * [WP Term Images](https://wordpress.org/plugins/wp-term-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-term-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-term-images/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-term-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-term-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-term-images/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [John James Jacoby](https://wordpress.org/support/users/johnjamesjacoby/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/need-wp_get_attachment_image_src/#post-6959456)
 * Status: resolved