Code Snippets

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.


Add Yours →

thanks for the code, i m actully looking for solution for arabic numbers within the page, if i have text box or text area want to add number and show them arabic, it is always coming englishg, please any help

Leave a Reply