Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to display line breaks in the German translation as in the original English version, but WPML does not transfer the line breaks. Specifically, for a

<h2>

header in mobile view, WPML squeezes all sentences into a single line.
Solution:
The issue was related to the Divi theme, where the header was tagged as

<h2>

for desktop and tablet but as

<p>

for mobile. Changing the tag from

<p>

to

<h2>

in the mobile view resolved the issue.

If this solution does not apply to your case, or if it seems outdated, we recommend checking the related known issues and verifying that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 0 replies, has 0 voices.

Last updated by igorL-20 2 weeks ago.

Assisted by: Noman.

Author Posts
January 6, 2025 at 1:35 pm #16566505

igorL-20

Background of the issue:
I am trying to display the line breaks in the German translation as in the original English version. WPML does not transfer the line breaks. As for the header, I could fix it with . But for a header, the tag doesn't work, and WPML squeezes all sentences into a single line. The issue can be seen on hidden link.

Symptoms:
Line breaks are not displayed in the translations in the mobile view. WPML squeezes all sentences into a single line for the header.

Questions:
How can I ensure line breaks are preserved in WPML translations for headers?

January 6, 2025 at 2:52 pm #16566825

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

To take a closer look at this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

Your next answer will be private, meaning only you and I can access it.

=== Please backup your database and website ===

✙ I would additionally need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is essential.

Thank you

January 7, 2025 at 8:51 am #16568509

igorL-20

The issue was caused by Divi, which we use as a theme builder. I looked into the design and recognised that the header was tagged as

for desktop and tablet but as

for mobile. Changing the tag solved the issue.