This thread is resolved. Here is a description of the problem and solution.
Problem: The client reported that a part of the translations was missing on the frontend of their website, even though the translations were present in the backend. Solution: Firstly, we recommended that the client update their WPML plugin and add-ons to the latest version to ensure they have all the recent bug fixes and improvements. We provided instructions for updating WPML and suggested backing up the database before proceeding, recommending the Duplicator plugin for this purpose.
After the client updated the plugins, we identified a PHP fatal error in the theme's file
section-hohtomaten.php
on line 12. We advised the client to contact their theme developer to resolve this error, as it was likely preventing the page from fully loading and displaying the translations on the frontend.
If you're experiencing a similar issue, we recommend you first update your WPML plugin and add-ons, and then check for any errors in your theme files. If the solution provided here is not relevant to your case, perhaps because it's outdated or doesn't apply to your situation, please check the related known issues and confirm that you have installed the latest versions of your themes and plugins. If the issue persists, we highly recommend opening a new support ticket with us 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.
Could you please update your WPML plugin to the latest version 4.6.10 and add-ons to benefit from the latest bug fixes and improvements? This may not necessarily resolve your problem, however, in order to troubleshoot the issue best we need to work on the latest code available.
You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/
It looks like the page is not fully loaded. It could be due to some fatal error on the translated page.
Please enable the enable debug.log. You can add a few lines to the site’s wp-config.php file. With the error log enabled, you will see the actual problem.
To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);
In order to enable the error logging to a file on the server you need to add yet one more similar line:
define( 'WP_DEBUG_LOG', true );
In this case, the errors will be saved to a debug.log log file inside the /wp-content/directory.
I activated the debug log. I see some errors, but maybe you can point me in the right direction because I don't really understand what the problem is looking at all the notices and errors.
Could you please share here the content of the debug.log? If there are any errors, the debug.log will be created automatically. You can delete it and view the translated page, and then share the contents of the debug.log.
I deleted the debug file and visited the page with missing content (hidden link).
This is in the debug log file:
[10-Apr-2024 20:11:08 UTC] PHP Notice: Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the animate-style handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\functions.php on line 6031
[10-Apr-2024 20:11:08 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the animate-js handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\functions.php on line 6031
[10-Apr-2024 20:11:09 UTC] PHP Warning: Array to string conversion in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\plugins\advanced-custom-fields-pro\includes\api\api-template.php on line 868
[10-Apr-2024 20:11:09 UTC] PHP Warning: Array to string conversion in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\plugins\advanced-custom-fields-pro\includes\api\api-template.php on line 884
[10-Apr-2024 20:11:09 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\hoh-blocks\section-hohtomaten.php:12
Stack trace:
#0 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template.php(792): require()
#1 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template.php(725): load_template()
#2 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\general-template.php(206): locate_template()
#3 D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\page-home.php(19): get_template_part()
#4 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template-loader.php(106): include('...')
#5 D:\vhosts\harvestofhealth.nl\httpdocs\wp-blog-header.php(19): require_once('...')
#6 D:\vhosts\harvestofhealth.nl\httpdocs\index.php(17): require('...')
#7 {main}
thrown in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\hoh-blocks\section-hohtomaten.php on line 12
[10-Apr-2024 20:11:10 UTC] PHP Notice: Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the animate-style handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\functions.php on line 6031
[10-Apr-2024 20:11:10 UTC] PHP Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the animate-js handle. Please see <a>Debugging in WordPress for more information. (This message was added in version 3.3.0.) in D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\functions.php on line 6031
Thank you for sharing the information. I noticed the following error that probably prevented the page from fully loaded:
[10-Apr-2024 20:11:09 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\hoh-blocks\section-hohtomaten.php:12
Stack trace:
#0 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template.php(792): require()
#1 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template.php(725): load_template()
#2 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\general-template.php(206): locate_template()
#3 D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\page-home.php(19): get_template_part()
#4 D:\vhosts\harvestofhealth.nl\httpdocs\wp-includes\template-loader.php(106): include('...')
#5 D:\vhosts\harvestofhealth.nl\httpdocs\wp-blog-header.php(19): require_once('...')
#6 D:\vhosts\harvestofhealth.nl\httpdocs\index.php(17): require('...')
#7 {main}
thrown in D:\vhosts\harvestofhealth.nl\httpdocs\wp-content\themes\hoh\hoh-blocks\section-hohtomaten.php on line 12
The theme you are using has a fatal error on line 12 in the section-hohtomaten.php file. You need to contact your theme developer and ask him to handle this error.