1

I'm trying to use Divi's pricing modules, but want the "subtitle" field to be broken into two lines. Normally, I can just add a break tag to the Divi field, and it reads it normally and breaks the line, but for some reason, it's spitting out this html:

<span class="et_pb_best_value">50% of 1st Month's Rent&lt;br /&gt;7.5% of Monthly Rent*</span>

I thought maybe I could use jQuery to add a break tag, but I'm not super familiar with jQuery.

Here's what I tried most recently, and it doesn't seem to do anything at all on the website:

jQuery('.et_pb_best_value').html(function(_, curr){
    return curr.replace(',', '<br />');
});
<span class="et_pb_best_value">50% of 1st Month's Rent,7.5% of Monthly Rent*</span>
phuzi
  • 12,078
  • 3
  • 26
  • 50
  • Did you include jQuery in the page via a ` – phuzi Mar 03 '21 at 22:45
  • @phuzi Yes, the jQuery library is enqueued in the functions.php file and works on every page – Garrett Lushington Mar 03 '21 at 22:49
  • If you include jQuery in the snippet above then it appears to work! – phuzi Mar 03 '21 at 22:51
  • Show us the code you are using to create the first span. – phuzi Mar 03 '21 at 22:52
  • @phuzi The code is generated by Divi. I just type in "50% of 1st Month's Rent,7.5% of Monthly Rent*" and the html I see in the inspect tool is 50% of 1st Month's Rent,7.5% of Monthly Rent* Here's the URL if it helps: http://piersidepmstag.wpengine.com/pricing/ – Garrett Lushington Mar 03 '21 at 22:58

0 Answers0