Recently, my WordPress site was updated and the Woocommerce product pages are now showing the <br>
code in our product titles as text.
Displays: "New <br> Collection"
on product page.
In page source, the code is showing as
<h1 class="product_title entry-title">
New<br>Collection</h1>
<p class="price"></p>
How do I fix this so there is a line break to display the product title as…
"New
Collection"
Thanks in advance.
2
Answers
If you cannot fix it in code then try
Solution from @mplungjan is really useful. I waste hours to try to found a PHP solution without success. JS code do not decrease performance at all, the only problem is that in case your DOM loading is slow, the chars could be displayed in page, before script change it. I added it in function.php @mplungjan suggest like below.
This issue is appeared after WooCommerce plugin upgrade. This happen only in single product page and is not displayed in Titles inside products list page.
Added it: