WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Get different images sizes for $image_link

[Resolved] Get different images sizes for $image_link

  • I need to print two different $image_link depending whether if you’re logged in or not. I added an extra variable but I can’t figure out how to get the correct image sizes. Using ‘full’ and ‘large’ in the code below doesn’t work.

    $image_link = wp_get_attachment_url( get_post_thumbnail_id() );
    $hiresimage_image_link = wp_get_attachment_url( get_post_thumbnail_id() );

    Does anyone know how to get the different image sizes in woocommerce (product-image.php)

    Thanks!

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Wohoo! I’ve solved it.

    $image_link = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘large’);
    $hiresimage_image_link = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’);

    Get’s me an array and the first item in the array is the image url so I just use

    $hiresimage_image_link[0]
    $image_link[0]

    thank you, helped me very much! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Get different images sizes for $image_link’ is closed to new replies.