We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Insert Line Break in Heading

Solved

Insert Line Break in Heading

JC113
Excursionist
17 1 9

Hi there!

 

I'm using Symmetry and on our "About" page (https://casa-amao.com/pages/about), I want to force a line break in the heading of one of the custom content sections to have it look like: 

 

Nachhaltigkeit und Qualität

Ästhetik und Funktion

 

Since the <br> does not work in the heading field, does anyone have a suggestion how to solve this?

 

Thanks in advance!

Accepted Solution (1)

PageFly-Amelia
Shopify Partner
626 165 238

This is an accepted solution.

Hello @JC113 

This is Amelia at PageFly - Shopify Advanced Page Builder app.

 

You can try the following steps I have provided to help you solve the problem you are facing:

Step 1: Online Stores > Themes > Edit code

Step 2: Choose file theme.liquid

Step 3: Add code above the tag </head>

<script>
window.addEventListener('load', () => {
   let el = document.querySelector('#block-id-text_WfzxJ3 .majortitle');
   el.innerHTML = el.innerText.split(', ')[0] + '</br>' + el.innerText.split(', ')[1]
})
</script>

 

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 5 (5)

PageFly-Amelia
Shopify Partner
626 165 238

This is an accepted solution.

Hello @JC113 

This is Amelia at PageFly - Shopify Advanced Page Builder app.

 

You can try the following steps I have provided to help you solve the problem you are facing:

Step 1: Online Stores > Themes > Edit code

Step 2: Choose file theme.liquid

Step 3: Add code above the tag </head>

<script>
window.addEventListener('load', () => {
   let el = document.querySelector('#block-id-text_WfzxJ3 .majortitle');
   el.innerHTML = el.innerText.split(', ')[0] + '</br>' + el.innerText.split(', ')[1]
})
</script>

 

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

JC113
Excursionist
17 1 9

Thanks Amelia! It worked 👍

PageFly-Amelia
Shopify Partner
626 165 238

You're welcome

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

theholdingsco
Visitor
1 0 0

I want to do the same for two sections in this Honey theme at lunartape.com. I don't know why it's giving me issues now.

HYPOALLERGENIC.
SKIN-SAFE.
RESIDUE-FREE.

 

and then this section too:

Facial hair? Sensitive skin?
We've got you covered.

I really appreciate your help with this.

braelyn
Visitor
1 0 0

Hi there! I tried this solution, and it originally worked. But now it's not working, and saying <br> is invalid again. Do you have any idea why this might be happenign?