On some stores it may be beneficial to collapse the single product page tabs so they appear under each other. This may also be better for SEO as Google can penalise hidden content.
I found an easy solution for this; the WooCommerce Expand Tabs plugin. Simply install and enable it within the plugin settings. You have options to enable it for desktop or mobile devices, or both.
To display tab titles
If you wish to display the tab titles, you’ll need to add a custom function, and a line of CSS.
This would go into a child theme’s function’s.php file.
1 2 3 4 |
add_action( 'after_setup_theme', 'cg_add_desc_tab_title', 99 ); function cg_add_desc_tab_title() { remove_filter( 'woocommerce_product_description_heading', '__return_null' ); } |
1 2 3 4 |
.panel.woocommerce-Tabs-panel--additional_information h2:first-of-type, .panel.woocommerce-Tabs-panel--reviews h2:first-of-type { display: block; } |