Archived topic
Woocommerce product archive not working with new flexbox
45 replies · Started by moderndev on October 6, 2020
Yes, exactly. If it's removed from the template and nothing displays, you can add it as an Element and it shouldn't show up twice.
Thats done and there is no title or description now. I did this by removing the wooarchive block from the child template.
I have not added any hook elements.
Whats next?
Ok I added it back using the hook element, but its in the wrong position. Its not full width and above the side bar?
https://moderncooking.com/en/product-category/kitchen-knives/?purge_success=1&cache_type=all
I changed it from generate_before_main_content to inside_site_container is that ok?
Yes, that should work perfectly :)
sorry I meant generate_inside_container
generate_inside_site_container will work - generate_inside_container will have flexbox issues.
Ok so this is looking correct. So, now you think the flexbox setting will work?
I just tried and nothing has changed. I am not sure what we have achieved here. I still have a child template, but now I have a hook element as well and in the end I am in the same position. flexbox doesnt work on those pages???
Sorry just seeing you comment above
Ok now we are looking good. Everything seems to be working well. Do you another way to remove the head so I can get rid of the child template?
You mean remove the archive header that comes with WooCommerce? If you re-name the child template, does it come back?
Yes, because the only reason that it is not displaying is because I have removed it in the child theme
That's what the options in Customize > Layout > WooCommerce should do.
However, looking at the template, there's no way to remove the wrapper around the title and archive: https://github.com/woocommerce/woocommerce/blob/master/templates/archive-product.php#L32-L46
Ok thanks Tom.
Maybe I will play around with the styling and see if I can remove the wrapper