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 4 replies, has 2 voices.

Last updated by Mihai Apetrei 1 month, 2 weeks ago.

Assigned support staff: Mihai Apetrei.

Author Posts
April 9, 2020 at 10:52 am #5875161

luisS-26

1.- Tell us what you are trying to do?

Hi. I'm trying to translate a post. Apparently everything is ok, but when showing in the front end, the paragraphs are not inside <p> tags, but it is adding it inside a <div> as text without format.

When I log into the page in German not from WPML translation page but the edit post button, it shows the message: "This block contains unexpected or invalid content."

2.- What is the link to your site?

English:
hidden link

German:
hidden link

April 9, 2020 at 2:33 pm #5876865

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for contacting WPML Support!

I will be happy to help you with this.

First of all, thank you very much for your patience and sorry to have you waiting - there is a very full ticket queue at the moment and it takes us a bit more than usual to answer tickets.

Now, regarding your request, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of the site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this: hidden link

I will be waiting for your response.

Kind regards,
Mihai Apetrei

April 10, 2020 at 9:43 am #5882707

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for the credentials.

I ran some tests by enabling a WP-default theme (Twenty Twenty) and by disabling all the non-WPML plugins and the issue was still happening on your server.

I then created a test website and tried to recreate the issue from scratch:

- hidden link (default language)
- hidden link (translation)

I was not able to recreate the issue from scratch on a clean environment so there seems to be an issue with your WordPress setup / server settings.

Can you please let me know if there's any custom code or settings that you've made inside your WP files or inside the server settings?

From what I see, your texts are added inside a <div> file and the paragraph file gets added at the top and it's completely empty.

I also found 2 workarounds on your site:

1. You can add the <p> tags manually (you can see it working here - hidden link)

I will also attach a screenshot so that you can see what I did.

2. You can use this custom CSS code so that we target the <div> that's created instead of the <p> and we give it the same styling as the paragraphs (you can add this CSS code inside Appearance > Customize > Custom CSS and save):

.page-content div {
    margin-bottom: 4rem !important;
    font-family: "Varela round",sans-serif !important;
    font-size: 2rem !important;
    line-height: 3rem !important;
    font-weight: 300 !important;
    font-style: normal !important;
    letter-spacing: 0em !important;
    color: var(--color-texto) !important;
}

Kind regards,
Mihai

April 10, 2020 at 11:39 am #5883639

luisS-26

Hi Mihai, thanks a lot for your help. I used your second workaround to get things done while find the origin of the issue. I used the most specific css selector

.page-content p+div

So the issue always create a <div> after a <p> inside of the parent <div>. It allows me not affect the rest of the divs of the entry (forms, for example).

I had the oficial Gutenberg plugin installed and active first time I saw the problem. Then I uninstalled and deleted it. Later I created this post to be fresh with just the standard Gutenberg from the WP Core and as the problem persists I opened this ticket.

The theme is based on the structure of Hello theme from elementor. The few lines added to functions.php are:

// Opciones del tema

add_theme_support( 'menus' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'align-wide' );
add_theme_support( 'html5', array(
'comment-list',
'comment-form',
'search-form',
'gallery',
'caption',
)
);
remove_action( 'wp_head', 'wp_generator' );

/* add_theme_support( 'post-formats', array(
'aside',
'gallery',
'link',
'image',
'quote',
'status',
'video',
'audio',
'chat'
)
); */

// Desabilitar emoji's

function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );

// Remove from TinyMCE
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );

// Deshabilitar tinymce emoji plugin.

function disable_emojis_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
}

// Añadir categorías a las páginas

add_action( 'init', 'add_categories_to_pages' );
function add_categories_to_pages() {
register_taxonomy_for_object_type( 'category', 'page' );
}

// Mostrar menu bloques globales en el admin de WP

function mostrar_bloques_globales_admin_menu() {
add_menu_page( 'Bloques globales', 'Bloques globales', 'edit_posts', 'edit.php?post_type=wp_block', '', 'dashicons-editor-table', 22 );
}
add_action( 'admin_menu', 'mostrar_bloques_globales_admin_menu' );

?>

Thanks!

April 10, 2020 at 6:24 pm #5885725

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi and thank you for your confirmation.

Yes, I don't know what's causing it but it was working just fine on a clean install with only the WPML plugins active so something is definitely happening in your setup I guess.

But I'm happy to hear that the workaround works fine for you for the moment. 🙂

Kind regards,
Mihai