• Resolved medafighterX

    (@medafighterx)


    Hi guys! I need help regarding the woocommerce plugin. Does anyone know how can I loop the product images as a list? Apparently, woocommerce has 2 php files for this. One is for the featured product, and one is for the product thumbnails (product-image.php & product-thumbnails.php) I’d like to put them on a single php file and loop the product images and make them appear in a list. Thanks in advance!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Would like an answer to this too, anyone?

    Thread Starter medafighterX

    (@medafighterx)

    Hello PagePlusCA!
    Apparently, I was able to solve this problem myself using this code:

    <ul>
    <?php
     $args = array(
       'post_type' => 'attachment',
       'numberposts' => -1,
       'post_status' => null,
       'post_parent' => $post->ID
      );
    
      $attachments = get_posts( $args );
         if ( $attachments ) {
            foreach ( $attachments as $attachment ) {
               echo '<li>';
               echo wp_get_attachment_image( $attachment->ID, 'thumbnail' );
               echo '</li>';
              }
         }
    ?>
    </ul>

    Since no one answered anyway. 😐
    I’m not really a programmer but I hope this could help.

    Apologies for the dumb question but did you end up combining the files and putting that code in there? Anything helps since no one has the answer, so thanks!

    Thread Starter medafighterX

    (@medafighterx)

    Actually, it only shows a list of product thumbnails. If you want the original size, you could replace
    echo wp_get_attachment_image( $attachment->ID, 'thumbnail' );
    to
    echo wp_get_attachment_image( $attachment->ID, 'full' );

    I only used product-image.php and removed the rest of the product-thumbnails.php

    `

    Hi I’m having problems with getting my images on my product page to not look distorted. Can someone help me?

    Site: http://www.wealtheelifestyle.com/shop

    Thread Starter medafighterX

    (@medafighterx)

    Hi wontonnie! I think it has something to do with the css or the width & height of the product thumbnails of the catalog. Try checking out Settings > Catalog > Image Options and adjust the width & height. I also recommend using the regenerate thumbnails plugin after saving the settings. 🙂

    Yeah I’ve done that countless times but every different sizes I used still makes the image blurry.. I’ve been using the regenerate thumbnails plugin too.

    Every time I change the thumbnail the actual thumbnail on the product page doesn’t correspond to the size I’ve put.. I don’t know what’s going on!

    Thread Starter medafighterX

    (@medafighterx)

    How about in the Media settings? Have you tried modifying the settings there as well?
    Btw, did you uncheck the “hard crop” option?

    No I have not. What am I suppose to in the media settings?

    Thanks for taking time to help me

    Thread Starter medafighterX

    (@medafighterx)

    No problem. Try adjusting the image settings there as well. And make sure you uncheck the “Crop thumbnail to exact dimensions” box.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Woocommerce] Product Images’ is closed to new replies.