How to Remove H3 Tag in WooCommerce Reviews
I recently found a small code that will be useful for those who develop online stores or who have their own.
I think it's no secret that on the pages of the site in the headings H1 – H6 should contain only important information that reflects the essence of the page, this will have a positive effect on the promotion of the site on the Internet.
Recently, I received an audit from a client in which there was an interesting point, which I hadn't thought about before. It turns out WooCommerce standardly adds a small piece of text wrapped in an H3 heading like this to the reviews section Be the first, who left a review on “Product name”. I googled the internet and found a solution to this problem., now I decided to share it with you.
For the script to work, you need to insert it into a file function.php your topic. The H3 tag will be replaced with the tag <p> with the same classes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function my_comment_form_before() { ob_start(); } add_action( 'comment_form_before', 'my_comment_form_before' ); function my_comment_form_after() { $html = ob_get_clean(); $html = preg_replace( '/<h3 id="reply-title"(.*)>(.*)<\/h3>/', '<p id="reply-title"\1>\2</p>', $html ); echo $html; } add_action( 'comment_form_after', 'my_comment_form_after' ); |
That's all in general. All the successful development of online stores.
/*
- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.