Skip Navigation

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.

This topic contains 8 replies, has 2 voices.

Last updated by Subash Chandra Poudel 1 year, 9 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
July 1, 2023 at 8:57 am #13927195

christineH-12

Tell us what you are trying to do?
I am trying to solve a 404 error on a custom post type.
I use Flatsome theme. You can enable a portfolio, which is a custom post type. You can customize the slug for it.
I customized the slug to books.
I added books to string translation.
Domain: admin_texts_theme_mods_flatsome-child
Name of string: [theme_mods_flatsome-child]featured_items_page
If I go to a portfolio item page in English and mouse over "français" in the top navigation I can see that the URL is the French portfolio item e.g. /name-FR-article but with the permalink books (/books/name-FR-article). In the backend, I also see that my French portfolio items have the permalink /books/.
If I click on "français" in the top navigation, there is a redirect to the permalink /livres/name-FR-article (the desired slug) but it gives a 404 error.

Is there any documentation that you are following?
I looked at your article https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/#troubleshooting-customizable-slugs
But the custom slug is not registered in admin-texts
And flush rewrite rules seem to be handled by the theme correctly because I can change the custom slug over and over again.

What is the link to your site?
site is cartaexplora.com but it is in maintenance mode.

Thanks in advance for your help. I am rather discouraged. I spent hours trying to solve this. And Flatsome is a well-known theme so I imagine that it is coded properly.
What am I doing wrong?

July 3, 2023 at 6:14 pm #13935953

Subash Chandra Poudel

Hi there,

Can you please remove the slug from String Translation then translate the slug from WPML -> Settings -> Post Type Translation instead as explained in the next document and see if it helps?

https://wpml.org/documentation/getting-started-guide/translating-page-slugs/#translating-a-post-types-url

July 4, 2023 at 11:20 am #13940269

christineH-12

I had already followed these instructions. But it doesn't work. The default post type name is featured_item and we cannot change the name in the original language. See here in the image. This is a customizable post type name.

Screenshot 2023-07-04 WPML featured item.png
July 4, 2023 at 5:30 pm #13944217

Subash Chandra Poudel

Thank you for the updates.

I would need to take a closer look at your site. So would you please mind sharing temporary access (WP-Admin and FTP) to your site? Preferably to a test site where the problem has been replicated.

I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.

IMPORTANT: Please take a complete backup of the site first to avoid data loss.

✙ I would additionally need your permission to make a copy of the site with plugins like Duplicator and deploy it in my local machine to test the issue further.

July 5, 2023 at 11:35 am #13949699

christineH-12

Hi Subash,
I appreciate the help. To give you temporary access, it seems that I need your email address in order to create a user.
If you plan to install Duplicator and make a copy of the site to your local machine, it seems that you should not need FTP access (I am not comfortable giving FTP access to my site).
Looking forward to hearing from you.
Thanks,
Christine

July 5, 2023 at 4:33 pm #13952835

Subash Chandra Poudel

Hi Christine,

You can use my email subash.cp@onthegosystems.com
Once you create a user please also make sure to share the credentials in the private reply fields for reference. I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.

IMPORTANT: Please take a complete backup of the site first to avoid data loss.

July 6, 2023 at 8:17 am #13956235

christineH-12

I tried to make a copy of the website, but it failed. It gave me a bunch of errors and they are related to WPML. See image

Screenshot 2023-07-06 Carta Explora clone 2.png
July 6, 2023 at 1:56 pm #13960677

Subash Chandra Poudel

Hi Christine,

The error seems to be caused due to the low WordPress memory limit on the site. I see the site has only 40 MB of WordPress Memory Limit. As explained in the document linked next the minimum requirement for WPML is 128 MB

https://wpml.org/home/minimum-requirements/

Please add this near the end in your wp-config.php file (just before /* That's all, stop editing! Happy blogging. */
) as explained in the next link

Then, see if it makes any difference.
{code}
/** WP Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
{/code}

https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/#how-to-increase-your-sites-memory-limit

The wp-config.php file is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

Once the WP memory limit is increased please check if it helps with the issue if not the error you send in the previous reply should be resolved so please proceed with creating a backup package.

July 7, 2023 at 2:09 pm #13968573

Subash Chandra Poudel

Hi Christine,

Thank you for the details. The login credentials didn't worked. However I was able to replicate the site with the package and was able to troubleshoot it further.

So, when you set a Portfolio page from: Theme Options > Portfolio > Custom Portfolio Page it is setting a custom permalink structure for Portfolio items. And as explained in the next link WPML supports only custom slug translation (when the custom type is registered) but not custom permalink structure

https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/#troubleshooting-customizable-slugs

To resolve the issue can you please the the following steps exactly and see if it helps:

- Backup the site first to prevent any issues.

- On your site, go to WPML -> String Translation select the string "[theme_mods_flatsome-child]featured_items_page" and delete it with the delete string button at the end of the table.

- Go to wp-admin Dashboard, and switch to the French language from the language switcher in top bar if you are not already on French.

- Go to "Theme Options > Portfolio > Custom Portfolio Page" and make sure if some page is selected there unselect it. Or set it to "select a page:" and publish.

- Go to wp-admin Dashboard again, and switch to the English language from the language switcher in top bar.

- Again, go back to "Theme Options > Portfolio > Custom Portfolio Page" and make sure if some page is selected there unselect it. Or set it to "select a page:" and publish.

- Now, go to WPML -> Settings and scroll to "Post type translation"

- As shown on the screenshot attached, find the "Portfolio (featured_item)" and select the option below it to set different slug for different language. Now since the default value "featured_item" is not what you want, on the left side of it, select a different language for it that you will not use, like "Nepali"

- Now translate or set the slug you want for French and English there and save.

- Finally go to Settings -> Permalinks and save the settings.

Regards,
Subash

Paramètres ‹ Carta Explora — WordPress - Google Ch.png