Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save webtoffee-git/d273aa1c0c015ff5179acecf21273c0f to your computer and use it in GitHub Desktop.
Save webtoffee-git/d273aa1c0c015ff5179acecf21273c0f to your computer and use it in GitHub Desktop.
<?php //Do not copy this line of code
add_action('wp_footer', function () {
if (is_product()) {
?>
<script>
jQuery(document).ready(function () {
const container = jQuery('.wt-related-products');
if (container.length > 0) {
const h2 = container.find('.wt-crp-heading');
if (h2.length) {
const h3 = jQuery('<h3>', {
class: h2.attr('class'),
style: h2.attr('style'),
html: h2.html()
});
h2.replaceWith(h3);
}
}
});
</script>
<?php
}
}, 20);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment