Question

Any ideas how to configure Wordpress to get the date and page numbers in Eastern Arabic Numerals?

These are 0660 up till 0669 in UTF-8. I am talking about getting those numbers ٠١٢٣٤٥٦٧٨٩ replace those 0123456789. I am using Wordpress 2.7.

Was it helpful?

Solution

،السلام عليكم

This isn't possible using any of the default wordpress tools. The "Styling Page Links" documentation only provides limited customization of the page numbers.

So you have a couple options.

  1. Edit wp_link_pages() in wp-includes/post-template.php
    But this is pretty hackish, and will cause problems when it comes time to upgrade.
  2. Write a small plugin that bypasses wp_link_pages() entirely, possibly by editing an existing (WP Page Numbers) plugin.
    This has the benefit of being maintainable and portable (you could distribute the plugin).

In both cases you will have to do some mapping: { {0،٠}, {1,١}, {2, ٢} ....}, and do a string replacement after the page number calculation.

Also, I looked into the Arabic WP translation but it uses traditional numerals, which seems silly.

حظ سعيد يابشا

OTHER TIPS

I'd suggest that you don't do the replacement...

Keeping the normal numbers 0x40 to 0x49 allows search engines to search in the numbers. An Arab who prefers the other number system would have set that in their operating system, and they would see 0123456789 as ٠١٢٣٤٥٦٧٨٩.

In case anyone else is searching you can use

<?php echo date_i18n(get_option('date_format')); ?>

http://codex.wordpress.org/Function_Reference/date_i18n

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top