Skip to content

Instantly share code, notes, and snippets.

@jmabbas
Last active February 16, 2026 12:19
Show Gist options
  • Select an option

  • Save jmabbas/26b83c9f2b5069e6adf776041bded79c to your computer and use it in GitHub Desktop.

Select an option

Save jmabbas/26b83c9f2b5069e6adf776041bded79c to your computer and use it in GitHub Desktop.
Furnique - Load tab view on single product tabs
add_action('wp_footer', function () {
if ( ! is_product() ) return;
?>
<script>
jQuery(document).ready(function($){
const $tabsWrapper = $('.woocommerce-tabs');
const $tabsList = $tabsWrapper.find('ul.tabs');
$('.woocommerce-Tabs-panel > li[role="presentation"]').each(function(){
$(this).appendTo($tabsList);
});
$tabsWrapper.removeClass('is-style-accordion');
$('.woocommerce-Tabs-panel').hide();
$('.woocommerce-Tabs-panel.active').show();
$tabsList.find('a').off('click').on('click', function(e){
e.preventDefault();
const target = $(this).attr('href');
$tabsList.find('li').removeClass('active');
$(this).parent().addClass('active');
$('.woocommerce-Tabs-panel').hide().removeClass('active');
$(target).show().addClass('active');
});
});
</script>
<?php
}, 999);
html body .wp-block-woocommerce-product-details.is-style-minimal ul.tabs.wc-tabs {
display:block;
}
.woocommerce div.product .woocommerce-tabs .panel {
display: none !important;
}
.wp-block-woocommerce-product-details.is-style-accordion .wc-tab h2,
.woocommerce div.product .woocommerce-tabs .panel.active {
display: block !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment