I use WordPress blog and I post in Arabic language. My idea is, for example, my basic category is astronomy, but I want it to be appearing to visitors in different language like الفلك, but without changing basic category itself. Because when Arabic visitors visit my site, they see box on each post inside the name of the category.

For example, when the category is astronomy, I want to see it as الفلك like this Arabic site.

It's code is like:

<div class="entry-category">
    <a href="url/(((((([basic category]biology)))))))))" class="gridlove-cat gridlove-cat-17">((((([diffrent name]البيولوجية)))))</a>

and my site appears like:

<a href="url of site /category/(([basic category]technology))))/" class="gridlove-cat gridlove-cat-5" data-wpel-link="internal">(((([differnt name ]Technology))))</a>

Here, basic category is Technology and appears to the visitors as Technology.

But I want basic category like Technology, News etc. in another language, just like the menu bar, where the link is as the basic category name but the anchor text is different.

Example Screenshot


You need to make your category name translation ready. You can do so by using WordPress functions such as __('Your category','your-text-domain'), _x('Your Category', 'your context', 'text domain') and more click here. After that, you can use poedit or other tool to extract translatable strings form your code and create your_locale.po file which contain your custom translation strings.

  • yes,it works bro I used polylang plugin to translate my categories and it is everything amazing,thanks so much – ezzeddin aykal Apr 5 '18 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.