WPML with BeBuilder Templates and CPTs
Hey Team I have run into an interesting issue.
We have created various CPTs and are running WPML. As we are in development we are testing all sorts of components but we found an interesting issue. I will outline it step by step as it was easy to reproduce regardless of how we created the CPT.
- We create a standard CPT either using ACF or manually through PHP (No Problem)
- We create a test post (Displays as it should)
- We go to the BeBuilder Templates and see the CPT there with the archive and single post item (No Problem)
- We then create a template and set the conditions to properly capture only single posts for the template (Works without Issue)
- We enable WPML default setting (No Problem)
- We update the Template in BeBuilder for the CPT (Problem: The post now reverts back to a standard single post layout as used in blog posts with the next and previous post functions etc. as set under Theme Options)
- We re-apply the template, then clear caches and permalinks (No Change the issue persists and template is not applied)
- We clear the BeBuilder History and recreate the CSS, as well as clear the Cache under Performance. (The Issue Persists)
- We de-activate WPML (The Issue Persists)
- We re-apply the BeBuilder Template (Now the post type shows again with the appropriate template applied)
- We re-activate WPML (The post type still shows with the appropriate template and formatting)
- We update the BeBuilder Template (Problem: The post reverts again to the standard single post template)
We have troubleshot this multiple ways such as removing all additional plugins, including disabled plugins as well as uninstalling and reinstalling WPML just in case an error occurred there. Always with the same result. We checked our debug and php error logs and have no entries when this error occurs which is creating a bit of a headache for us.
Updated: BeBuilder Data Storage is set to Serialized.
Updated: WPML is set to have each language under a subfolder so domain.com/es/ or domain.com/fr/
Current Server Config:
Php Version: 8.3.28
Php Memory Limit: 2048M
Php Max Execution: 300
Php Upload Max: 256M
Php Post Max: 256M
Wp Version: 6.9
Wp Multisite: No
Wp Debug: Enabled
Wp Debug Log: Enabled
Wp Memory Limit: 1048M
Wp Max Memory: 2024M
Any help would be appreciated.
Philipp
Comments
Hey,
Please send us the WordPress dashboard and FTP access privately through the contact form, which is on the right side at https://themeforest.net/user/muffingroup#contact and we will check what might be the reason.
Notice!
Please attach a link to this forum discussion.
Sending incorrect or incomplete data will result in a longer response time.
Therefore, please ensure that the data you send are complete and correct.
Thanks
Thanks I sent the information and created the accounts for you.
I received your private message, but you did not attach a link to your website and FTP host address.
Please send another message with complete data.
Thanks
Oh wow... talk about an oversight on my end sending now.
Sorry, but we have not get any new message from you yet.
Please check your email inbox for our response. Look also inside the spam folder.
If you haven't received any message from us, please resend your login credentials.
Be sure that you sent all of the required information mentioned in the previous message.
Thanks
I received your new message, but it now contains a website address only, but there are no WP credentials, and you did not attach FTP credentials.
Please send another complete message just as I explained in points in my previous message.
Thanks
In your last message you still did not attach FTP access.
Anyway, did you change settings in the WPML?
I noticed that almost all Custom Fields Translations are set to "Don't translate":
It is incorrect. I tried to change the fields related to our theme, but there are many more, and I do not want to interfere with your settings too much. Please try to reset WPML settings to the default ones. If you do not know how to do it, please reach out to WPML support.
After resetting setting to default ones, check if the problem persists.
Thanks
Hi,
Sorry, with the FTP i went through and had thought i added it.
As far as the custom fields go, this was the standard setting by WPML, I couldn't find any documentation to state otherwise. We figured that not translating would ensure that WPML wouldn't interfere with the Theme. That being said I could see how that could also be a problem.
So should all the betheme custom fields be translatable then? (I haven't found any documentation to that effect hence my question)
All the WPML settings were reset to defaults and left as such for you as I didn't want incorrect customizations to interfere.
I should also ask how the templates are translated, as that would likely be the issue we are facing. Should they be set to translatable, copy, copy once?
If you have documentation which outlines the required settings i would truly appreciate it.
That is weird, as they do not seem to be standard WPML settings.
We do not have that in documentation because it was never needed, and we did not think about such a situation as yours.
I made a screenshot from the settings in our environment with WPML, so you can validate them, and adjust yours settings:
Did you try contacting WPML support regarding this? I am curious what they would say about that.
Best regards
Your Screenshot is bang on, well some items are missing but by replicating those items' settings the problem was resolved. I am noticing that updating a template for a language is still a bit hit and miss.
At times the translation takes the full settings from a template and others it doesn't.
That being said i would recommend putting a tutorial together based on your settings. :)
Thank you.
One quick question when a template has a language variant created are the language items intended to be draft items?
Sure thing, we will consider preparing an article/tutorial about that.
No, they should not be in Draft. Does it happens for you?
I found a similar problem on the WPML forum, please check it:
https://wpml.org/forums/topic/translated-products-left-as-drafts/
Best regards
Hi (btw what is your name? I'd like to be able to properly address you).
And yes, the language translations are being created as draft items under the templates. However only the templates. This coincides with the header templates translations working properly, but the post translations seem to be missing the post structure (with blocks) even though the translation (advanced editor) indicates it sees the components (blocks).
Thanks again for the great help.
My name is Phil 🙂.
I will log in to your website again and check what the reason could be for this.
Best regards
Thank you Phil, I appreciate that.
A bit more to the template not showing. I noticed that when i go to the WPML -> Translations and look at the blog post (last one in the list) and switch between English (Main navigation en) to french (fr) the blog shows with seemingly the standard blog post template.
We haven't put the spanish in place yet so no need to try. We have tried deleting the french blog post template and recreating it without a positive result.
We have tested the translations in settings by setting
mfn_template_conditions to: copy once
mfn_template_perpage to: copy once
mfn_template_type to: copy
as a test as well as the post items to copy. Based on the information from WPML it described that it would recreate the post with the templates we created but so far no success.
Your WPML link was correct. It was the draft setting in WPML.
Okay so i re-applied your provided settings (i think you may either have an older or newer version of Betheme installed as some line items are missing that we have in the latest release we have downloaded).
Re-applying the settings resolved the template issue. This is where we shrug our shoulders as we had the settings applied earlier and they didn't work. (unless you worked your magic already)
So to sum up, translations are working, the templates save as published items (as per wpml settings).
What i would welcome is a Betheme tutorial outlining required settings in WPML, as well as some of the complications which could arise and how Betheme handles translations with WPML (creating of language version templates, maybe naming scheme to avoid as I suspect our use of underscores in the name may have contributed to errors). Also WPML seems to warn users when doing an edit of the templates, but it isn't clear if editing the specific language templates in bebuilder could cause issues (i suspect if one then updates the main language it will override the language templates).
I did notice the Icon blocks Descriptions are not seen by WPML specifically the Icon Block and Description field. The Link Title however is seen by WPML.
Thank you for all your great help.