[Resolved] When I add a shortcode it breaks everything
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing issues where adding a WooCommerce shortcode breaks the page editing functionality, and you're unable to edit the page until you disable either WPML or WooCommerce plugins, the problem might be related to string translations. Solution: We recommend checking the WPML -> String Translation section for the specific string 'Select options for'. It's likely that the translation format is incorrect. You should change it from "%": Déan rogha to "%s": Déan rogha. This adjustment has been tested and should resolve the issue.
Regarding the removal of all current strings and using only .mo files, we advise against deleting strings from the String Translation as this will result in strings appearing untranslated. It's essential to have them registered within the String Translation screen for proper functionality.
If this solution does not apply to your case, or if it seems outdated, 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 issues persist, 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.
Background of the issue:
If I add a WC short code it seems to break everything, I can no longer edit the page until I turn of either WPML WC plugins.
For example:
[featured_products limit="30" columns="4" orderby="date" order="desc"]
When I add this to a html widget, the wc content takes over and the page builder is broken like this: hidden link and I'm stuck.
I've brought this up with the theme developer and they've pointed out that this issue is due to JavaScript errors with both your plugins, they explain it better than I here: hidden link
I have also tried in twenty twentyfour with all non relevant plugins disabled, same issue.
before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.
To enable debug.log, open your wp-config.php file and look for:
define('WP_DEBUG', false);
And change it to:
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
Then open the page you're having problems with and check if any errors were saved to the debug.log log file inside the “.../wp-content/” directory.
If there is any error showing on the file, please copy/paste the content of the debug.log file to https://pastebin.com/ and share with us that link.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello there,
I would like to request temporary access (wp-admin and FTP) to your staging site to take 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.
- Please make a backup of 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
Please, let me know if you need any additional details. Have a nice day.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello there,
Upon further review it looks like the issue is caused due to an issue with a string translation.
Please go to WPML -> String Translation (or Aistrigh giotaí téacs) and search for the string 'Select options for'. You'll notice that the translation of that string has an incorrect format.
Please change it from "%": Déan rogha to "%s": Déan rogha
That should fix the issue. I just tested it in the sandbox and it worked for me.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello David,
I'm afraid that deleting the strings in the String Translation will cause the strings to show up untranslated. Using only MO files won't work for all strings, it is better to have them registered within the String Translation screen for it to work properly.
I checked the staging site and I cannot reproduce the issue any longer, is it happening in a specific page now?