[Resolved] Translating issue in Recent Posts Grid of my website
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing issues with the Recent Posts Grid on your Home page and About Us page, where posts in different languages are displayed together regardless of the selected language, and even trashed posts are showing up, we have identified a solution. Solution: We recommend you modify the widget template code to correctly filter posts by language. Here are the steps to follow: 1. Navigate to "Appearance > Theme File Editor" and select your active theme. 2. Locate and open the "elementor-blog-grid.php" file within the "template-parts" folder. 3. Add the following line of code to query arguments:
'suppress_filters' => false
4. Save the changes. This adjustment should ensure that your posts are displayed in the correct language based on the current selection. Please note that if your theme or plugins are not officially compatible with WPML, our support for such customizations may be limited. We suggest contacting the theme's support team for further assistance and recommending that they join WPML's Go-Global program to improve compatibility. You can learn more about the Go-Global program here.
If this solution doesn't seem relevant to your issue, please don't hesitate to open a new support ticket here.
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.
Hello. I am new to wordpress and WPML. I am using Hanio theme to develop my website. I followed documentation of hidden link to develop my website. I used WPML to translate content of my website from English in Greek. For example, when I create an article, I create its translation in WPML.
Though, I am experiencing an issue with the Recent Posts Grid on the Home page and About Us page in section "Blog". No matter what language I choose, some of the posts appear in English and others in Greek. When I select to view the page in English, it should only display posts in English, and when I select to view the page in Greek, it should only display posts in Greek. Also, a post I threw in trash is also displayed in the middle, as you can see in the attached picture. But, by clicking the button "All Posts" in the "Home" and "AboutUs" pages and changing the language, the content will appear in the correct language. I would like your help, since I don't know how to solve this. My website is hidden link
Thank you for taking the time to review my issue. Looking forward to hearing from you soon.
Kathrin Panayotou
Hello Kathrin,
Thanks for contacting WPML Support.
I understand the issue you're having and will try my best to assist you in this matter.
While reviewing the Blog section on the Homepage, I noticed that the blog posts are being displayed using the theme's default Elementor widgets. It's important to note that if a widget does not have WPML support, it might not function correctly in other languages.
For your information, the Theme that you're using currently(Hanio) is not listed in our Compatible theme list. Therefore, it could be a compatibility issue as well.
To determine whether the issue is being caused by the use of the theme's default Elementor widget or if there are other factors involved, I would like to kindly request that you attempt to replicate the issue on our sandbox site. The Autologin link to access the site is provided below:
- hidden link
By clicking on the link, you'll be directed to a fresh WordPress site where WPML and the String Translation plugin are already installed. On this site, please install the same theme you are using on your main site, along with Elementor and any other plugins that may be necessary to recreate the issue.
After installing the necessary plugins, go ahead and create some dummy posts and translate them.
Once this setup is complete, create a new page, implement the same Elementor widget that you have used on your main site to display posts, and check if you're getting the same result or not.
This process will help us understand whether the issue is specific to the theme and its Elementor widgets or if something else is contributing to the problem.
Once you're able to recreate the issue in our sandbox, please let me know. I will take a closer look and try my best to assist you in solving the matter.
I created a sample page with Elementor and named it AboutUs. There i put a Recent Posts Grid, which shows 3 posts I created. You can see the issue I mentioned earlier in this post. hidden link
Hi There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.
Thank you for recreating the issue in our sandbox. I've taken a closer look and it seems the support for WPML hasn't been extended yet for the widgets. This is why, the default and translated posts are showing in the frontend all along.
However, by tweaking the code for the widget template, I was successfully been able to display the post correctly in each language. You can take a look at this page: hidden link
Here's the change I've made to make it work:
- I went to "Appearance > Theme File Editor" and selected the "Hanio" Theme
- Opened the "elementor-blog-grid.php" file under the "template-parts" folder
- Added the 'suppress_filters' argument and set it to "false". Please check this screenshot(hidden link) for a better understanding.
- Saved the changes.
By making the same changes on your site, hopefully, you'll be able to solve the issue.
While offering assistance for themes or plugins not officially compatible with WPML falls outside our standard support services, I've provided a straightforward solution for your convenience. For additional help, particularly with the default widgets of your theme, it's advisable to contact the theme's support team. As the translation support needs to be added by the Author, they will guide you better in these matters.
Furthermore, you might consider suggesting to the theme developers that they participate in WPML's Go-Global program. This program is designed to ensure compatibility with WPML, enhancing the multilingual capabilities of their plugin. You can find more details about the Go-Global program at this link: https://wpml.org/documentation/support/go-global-program/
If there is anything else you need help with, please let me know. I will be happy to help.