Arabic-Indic Numerals for Arabic WordPress

This simple code replaces Arabic numerals (a.k.a. Hindu-Arabic numerals or Indo-Arabic numerals) with Eastern Arabic numerals (a.k.a. Arabic–Indic numerals or Arabic Eastern numerals) in the date of posts or comments on WordPress. The Arabic version of WordPress changes the month names but leaves the numbers unchanged.

For the sake of simplicity I’m calling them “English” numbers and “Arabic” numbers.

You can install this as a plugin, or paste the code directly into your theme’s functions.php file.

This modifies the output of the built-in WordPress function for the time; however, for best results specify the date format as j F Y , either in WordPress settings, or directly when you call it using:
<?php echo get_the_time('j F Y'); ?>

Download plugin

This is based upon the answer to a question on Stack Overflow.

The following two tabs change content below.

Jeremy Varnham

Latest posts by Jeremy Varnham (see all)

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">