• Resolved luisbonie

    (@luisbonie)


    Ok, as you might know when I updated to 3.5 I noticed that I can not link images anymore ?? So am using the “WP Gallery Custom Links” plugin to place a link for my images… Problem is that am not needing it in the post or page, I need the product thumbnail under my featured image for my product page to link out and not to the image…

    Here is a screen shot…

    THANKS!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter luisbonie

    (@luisbonie)

    This is the field that I would like the thumbnail to use “attachments-262-gallery_link_url” but am not sure how to write it in the “wp_get_attachment_url( $attachment->ID )”

    am I going about this the right way?

    <?php
    global $post, $woocommerce;
    ?>
    <div class="thumbnails"><?php
    	$attachments = get_posts( array(
    		'post_type' 	=> 'attachment',
    		'numberposts' 	=> -1,
    		'post_status' 	=> null,
    		'post_parent' 	=> $post->ID,
    		'post__not_in'	=> array( get_post_thumbnail_id() ),
    		'post_mime_type'=> 'image',
    		'orderby'		=> 'menu_order',
    		'order'			=> 'ASC'
    	) );
    	if ($attachments) {
    
    		$loop = 0;
    		$columns = apply_filters( 'woocommerce_product_thumbnails_columns', 3 );
    
    		foreach ( $attachments as $key => $attachment ) {
    
    			if ( get_post_meta( $attachment->ID, '_woocommerce_exclude_image', true ) == 1 )
    				continue;
    
    			$classes = array( 'zoom' );
    
    			if ( $loop == 0 || $loop % $columns == 0 )
    				$classes[] = 'first';
    
    			if ( ( $loop + 1 ) % $columns == 0 )
    				$classes[] = 'last';
    
    			printf( '<a href="%s" title="%s" rel="thumbnails" class="%s">%s</a>', wp_get_attachment_url( $attachment->ID ), esc_attr( $attachment->post_title ), implode(' ', $classes), wp_get_attachment_image( $attachment->ID, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) ) );
    
    			$loop++;
    
    		}
    	}
    ?></div>
    Thread Starter luisbonie

    (@luisbonie)

    Will close this… Sir Ben Blanco has made it happen for me… thanks anyway ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Please & Thank You – Image Links Not Working in 3.5’ is closed to new replies.