- This topic has 11 replies, 2 voices, and was last updated 3 years, 11 months ago by David.
-
AuthorPosts
-
May 27, 2020 at 6:42 am #1303407Marcel
I modified the Gallery Stack element a bit, in the sense that I want all Woocommerce products to have exactly the same images (if you are wondering why I would do this – they are different products but using the same materials, and the customer sees the materials in the pictures). I also added a video before the images. The problem is that on the desktop it’s fine, but on the mobile, I don’t see any change.
This is the code I added:<div class="woo-sumamry-wrap"><!-- open wrap --> <div class="woo-gallery-stack hide-on-mobile"> <iframe width="600" height="415" src="https://www.youtube.com/embed/KZ0f9A3kNiA"> </iframe> <img src="/wp-content/uploads/2020/05/2749.jpg" alt="Girl in a jacket" width="500" height="500"> <img src="/wp-content/uploads/2020/05/2746.jpg" alt="Girl in a jacket" width="500" height="500"> <img src="/wp-content/uploads/2020/05/2742-1.jpg" alt="Girl in a jacket" width="500" height="500"> <img src="/wp-content/uploads/2020/05/2739-1.jpg" alt="Girl in a jacket" width="500" height="500"> </div>
I’ve tried to remove from the additional CSS this snippet:
@media (min-width: 768px) { .woocommerce-product-gallery { display: none; }
but without any positive results on mobile.
I would also like to add captions under each image added in the Gallery Stack element. Can you guide me a little how to proceed? Thanks.
May 27, 2020 at 7:35 am #1303468DavidStaffCustomer SupportHi there,
in your HTML – see this line:
<div class="woo-gallery-stack hide-on-mobile">
remove the
hide-on-mobile
classMay 27, 2020 at 8:26 am #1303704MarcelPerfect. And how could I add captions under images?
May 27, 2020 at 8:41 am #1303723DavidStaffCustomer SupportAs you’re using Static HTML in the Hook you would need to add those captions in manually.
May 27, 2020 at 9:36 am #1303799MarcelDone. Thank you for that. And the last one: how to change the order of the grid template columns on mobile? Is it possible?
May 27, 2020 at 10:21 am #1303850DavidStaffCustomer SupportIf you want the Summary to come before the Gallery then add this CSS:
@media (max-width: 767px) { .woo-sumamry-wrap { display: flex; flex-direction: column; } .woocommerce #content div.product div.summary { order: -1; } }
May 27, 2020 at 12:28 pm #1303991MarcelDavid, thank you.
I promise this is the last question (for this topic :)): everything works nice, but on mobile, after the last image I have inserted in static HTML in the Gallery Stack element, it appears the woocommerce placeholder image. I would like to hide it. On the desktop, it does not appear, just on mobile.
Thank you!May 28, 2020 at 1:28 am #1304580DavidStaffCustomer SupportTry adding this PHP Snippet to your site:
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
May 28, 2020 at 2:01 am #1304626MarcelUnfortunately, it does not work. I think it is something related to mobile behaviour CSS, as long as the placeholder images appear only on mobile devices, but not on desktop.
May 28, 2020 at 2:17 am #1304645DavidStaffCustomer SupportWhere did you add that code ?
Alternatively yes the site does use CSS to remove it on desktop ie. this code:
@media (min-width: 768px) { .woocommerce-product-gallery { display: none; } }
For it to apply to both just move this:
.woocommerce-product-gallery { display: none; }
outside of the @
media (min-width: 768px) {}
May 28, 2020 at 2:51 am #1304690MarcelHello, David.
I’ve added the PHP code directly on function.php on my child-theme.
The CSS snippet modification solved my problem.
Thank you very much for your time and effort to solve my goal. I’ve made a small donation, in respect for your work and ongoing development.All the best,
MarcelMay 28, 2020 at 4:45 am #1304814DavidStaffCustomer Supportthats odd the PHP didn’t work.
But if the CSS works for you – then thats great!And thank you for the donation it’s really appreciated!
-
AuthorPosts
- You must be logged in to reply to this topic.