-
AuthorPosts
-
December 12, 2015 at 12:06 am #551315
Hello,
I noticed that when I use lightbox the theme loads the full size version of the image. We upload high-res images as source images so it is loading 3500+ px images. Is it possible to change it to extra-large or large?
It looks like all other sizes are loaded with the correct version instead.
Best
Sigifin
P.S.: I already tried this without effects:
function change_lightbox_size() { return "large"; // default is 'large' } add_filter('avf_avia_builder_helper_lightbox_size', 'change_lightbox_size', 10);
- This topic was modified 8 years, 11 months ago by sigifinsrl.
December 14, 2015 at 7:20 am #551964Hi sigifinsrl,
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Thanks,
RikardDecember 14, 2015 at 10:30 am #552061Hi Rikard,
thank you for the support, here you have the credentials.
It is a clean import of your shop template!
Best
Sigifin
December 16, 2015 at 10:06 am #553529Hello
I’m very interrested to know how to use this hook too.
I tried many things, change the excecution priority from the lowest to the highest and has no effects…December 21, 2015 at 6:10 pm #556102Hey!
I think this is more about a general WordPress issue, than a theme related one. So feel free to ask in general WordPress forum about it. Maybe this plugins could help you guys:
https://wordpress.org/plugins/max-image-size-control/
https://de.wordpress.org/plugins/simple-image-sizes/Cheers!
AndyDecember 21, 2015 at 7:20 pm #556137Hi Andy,
if this is the situation I suggest to use imsanity (https://wordpress.org/plugins/imsanity/), but this is not what I was looking for.
It looks very strange to me that you can’t set the lightbox to load a thumbnail instead of the original image, are you really sure about it?
Best
Sigifin
December 22, 2015 at 10:10 am #556401Hello
No answer about how to use Enfold ‘avf_avia_builder_helper_lightbox_size’ hook?
ThanksDecember 27, 2015 at 6:09 pm #557609Hey!
Sorry for the delay. Please replace the code in the functions.php file with this:
add_filter('single_product_large_thumbnail_size', funtion() { return 'large'; //default "shop_single" });
EDIT: Please ignore the code above. Use this instead:
add_filter('woocommerce_single_product_image_html','avia_woocommerce_post_thumbnail_description', 10, 2); function avia_woocommerce_post_thumbnail_description($img, $post_id) { global $post, $woocommerce, $product; if(has_post_thumbnail()) { $image_title = esc_attr(get_post_field('post_content', get_post_thumbnail_id())); $image_link = ;wp_get_attachment_image_src(get_post_thumbnail_id(), apply_filters('avf_avia_builder_helper__shop_lightbox_size','large')); $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( 'title' => $image_title ) ); $attachment_count = count( $product->get_gallery_attachment_ids() ); if ( $attachment_count > 0 ) { $gallery = '[product-gallery]'; } else { $gallery = ''; } return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link[0], $image_title, $image); } return $img; }
Regards,
IsmaelDecember 29, 2015 at 9:09 am #558041Hi @ismael
I’m afraid I do not understand your answer… Why do you give me php code about changing Woocommerce stuff?
My question was about how to use you ‘avf_avia_builder_helper_lightbox_size’ hook?
ThanksDecember 29, 2015 at 10:50 am #558050Hi Ismael,
when I use your code in a clean import of Enfold Shop Theme I get an error 500.
Best
Sigifin
December 31, 2015 at 3:35 am #558638Hey!
@pako69: The OP wanted to change the size of the PRODUCT images in the lightbox. The filter posted by the OP won’t affect the products. If possible, please create your own thread. Thank you.
@sigifinsrl: Please copy the code directly from this forum, not from your email. Let us know if it is working.Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.