Waiting for author
Reported for: إضافة WPML Multilingual CMS 4.5.14
Overview of the issue
When using WPML Sticky Links with Divi theme builder, internal links aren’t converted automatically. Instead, you will see links in a www.domain.com/?page_id=your-id format.
Workaround
Be sure to make a full backup of you site before proceeding.
- Open the …/wp-content/themes/Divi/includes/builder/core.php file.
- Add the following snippet after line 36:
// WPML Workaround for Sticky links if ( class_exists('WPML_Sticky_Links') ) { $sticky_links = new WPML_Sticky_Links(); add_filter( 'et_builder_render_layout', [ $sticky_links, 'show_permalinks' ] ); }
Will this workaround stick (no pun intended) after a Divi update?
Or how would one implement this in a Divi child theme?
Hey there,
It would depend on Divi’s update. However, you can always create a child theme as explained in WordPress handbook.
We will keep you updated of any change.
Regards
Hi Andrés
Thank you for your reply.
I do have a child theme, and it is my understanding that I can add modifications to the original files just by creating a file with the same name and path. However, how would I make sure that the modification (in this case the above snippet) is added in the right place (line 36)? If I copy the whole content of the core.php file, I imagine it could create problems if the original core.php file is changed in a future update?
Hello Alan,
Yes, that’s one of the risks of modifying files through a child theme. If you think is safer, you can modify the original file and monitor if it changes in the next update.
I also recommend you to contact Divi theme for this purpose. This will increase the priority of this issue and they may guide you better about how to add this modification.
Regards
Hi Andrés, thanks again for your reply.
I have now inserted the snippet in the original core.php file and will keep an eye on future Divi updates.
However, it doesn’t seem to have the effect I was hoping for.
What happened is, I installed WPML and Sticky Links, but noticed that some links were changed from …/directory/page to something like …/?p=53325 without apparent cause. So I deactivated Sticky Links in the hope to see those links convert back. That didn’t happen, so I activated the plugin again and inserted the snipped above, but still those links are in the …/?p=53325 format.
Maybe you have any suggestion?
If you are seeing that effect on the backend, that’s expected when you are using WPML Sticky Links.
However, if you are experiencing a different situation, I suggest you to open a chat in our support, in that way one of our specialists can investigate your case.
Regards