WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Get different images sizes for $image_link (3 posts)

  1. rhedman
    Member
    Posted 2 years ago #

    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/

  2. rhedman
    Member
    Posted 2 years ago #

    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]

  3. Webprom Design
    Member
    Posted 1 year ago #

    thank you, helped me very much! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags