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 thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to add category label to my translated posts. I have a PHP function that display label before post title. It works fine with default language (Polish), but do not work with their translation into English.

Solution: I had a look and I could see that you're using a custom theme. Also, I could see that the categories are added using the category_badge function. However, in order to get the categories in English, a separate function called category_badge_en is available.

The only function used in index.php file is category_badge that only takes the Polish badges. You need to use the category_badge_en function in this file too in order to have the English badges.

This topic contains 6 replies, has 2 voices.

Last updated by Radu 1 month, 1 week ago.

Assigned support staff: Radu.

Author Posts
August 30, 2019 at 12:43 pm #4487235

magdalenaM-8

I am trying to: add category label to my translated posts. I have php function that display label before post title. It works fine with default language (polish), but do not with their translation into English despite: 1. function is correct,2. posts and categories are marked as translated (they are connected into pairs PL-EN)

Link to a page where the issue can be seen: Polish post page with labels: hidden link; English post page without labels: hidden link

I expected to see: the same labels in both languages

Instead, I got: no labels at any of the posts.

August 30, 2019 at 12:55 pm #4487293

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Magdalena,

Thank you for reaching out the WPML support!

Can you go to Dashboard → WPML → Taxonomy translation, select Categories, and make sure that all the categories are translated to Polish, please? Just give this a try and tell me how things work this time.

Thanks,
Radu

August 30, 2019 at 1:08 pm #4487351

magdalenaM-8

unfortunatelly I can't do it that simple. WPML asks me to upload string transation plugin which I don't have :/ Is it necessary? It is additionally paid

September 1, 2019 at 8:10 pm #4493057

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Magdalena,

Could you give me access to the dashboard area of your website so I can have a closer look at the category labels, please? I just want to see how they are created and how we can make them appear on the English page too.

The next reply is set to be private so you can safely send me the credentials.

Thanks,
Radu

September 3, 2019 at 12:33 pm #4504461

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Magdalena,

Thank you for give me access to the dashboard area!

I had a look and I could see that you're using a custom theme. Also, I could see that the categories are added using the category_badge function. However, in order to get the categories in English, a separate function called category_badge_en is available.

The only function used in index.php file is category_badge that only takes the Polish badges. You need to use the category_badge_en function in this file too in order to have the English badges. Please give this a try and tell me how it goes.

Thanks,
Radu

September 3, 2019 at 1:03 pm #4504617

magdalenaM-8

Thanks Radu! It worked. I thought it must be simple solution 🙂
Thank you for your help and support.
best regards from Poland
Magdalena

September 4, 2019 at 9:59 am #4509885

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Magdalena,

I'm glad I could help you out!

I'll mark this ticket as resolved now. If you have any other question or issue, feel free to open a new ticket and we'll take care of it in no time.

Regards,
Radu