This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing issues when switching your website to English, such as missing parts of blocks on your homepage or changes in the menu width, it might be due to how certain fields are handled in your theme's code. Specifically, the
$person_image
field in the
wp-content/themes/hostal/pages/home.php
file may not be correctly set up for translations, leading to errors.
Solution:
We recommend the following steps to address this issue:
1. Adjust the Advanced Custom Fields (ACF) to ensure the field returns an image array for translations. This might require updating the translations.
2. Remove improperly set integer values in translations via SQL:
SELECT * FROM `wp_postmeta` WHERE `post_id` IN (512,459,513,456) AND `meta_key` = 'person_image';
3. Improve handling in your theme by adding code to manage different types of
$person_image
values:
if (is_int($person_image)) {<br /> $person_image['url'] = wp_get_attachment_image_url($person_image);<br />} elseif (is_string($person_image)) {<br /> $test = $person_image;<br /> $person_image = array();<br /> $person_image['url'] = $test;<br />}Insert this code after:
$featured_image_url = get_the_post_thumbnail_url(get_the_ID(), 'full');
If these steps do not resolve your issue, or if your theme has other similar issues, we highly recommend consulting with a professional developer. You can find qualified contractors who are familiar with WPML at https://wpml.org/contractors/.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket for further assistance.
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 7 replies, has 2 voices.
Last updated by 1 year, 8 months ago.
Assisted by: Bruno Kos.
