Support » Plugins » WordPress Attachments Plugins – get medium size of image

  • Hello friends Im use a WordPress Attachments Plugin Here is the link –

    I need to get or retrieve the medium size of the attached image.

    The plugin use and works width

    'mime' 			=> stripslashes( get_post_mime_type( $data['id'] ) ),
    				'title' 		=> stripslashes( $data['title'] ),
    				'caption' 		=> stripslashes( $data['caption'] ),
    				'location' 		=> stripslashes( wp_get_attachment_url( $data['id'] ) ),
    				'link'			=> stripslashes( wp_get_attachment_link( $data['id'] ) ),

    But cannot get the medium size or image_get_intermediate_size of the picure. I can retrieve only small and big size. Please for eny help or suggestions or hack. Many many thanks….

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’ll want to use wp_get_attachment_image_src with the attachment id you’re working with


    $my_image = wp_get_attachment_image_src( $attachments[$i]['id'], 'medium' );
    $my_image = $my_image[0];

    $my_image will contain the URL to your medium sized image.

    Hope that helps!

    not work 🙁

    is there another type to get – wp_get_attachment_image_src

    $attachment_details = array(
    						'id' 				=> $_POST['attachment_id_' . $i],
    						'title' 			=> $_POST['attachment_title_' . $i],
    						'caption' 			=> $_POST['attachment_caption_' . $i],
    						'order' 			=> $_POST['attachment_order_' . $i]

    Hello all this code works propertly but it show thelink and word Array
    how to fix it

    Example: Array….img.jpg

    <?=$my_image = $my_image = wp_get_attachment_image_src( $attachments[$i][‘id’], ‘medium’ ); ?>

    <?=$my_image = $my_image[0];?>

    How to use it not to shoo Array word before the link?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress Attachments Plugins – get medium size of image’ is closed to new replies.