I am doing a worpdress theme which is in Arabic language. When I write anything in Arabic. It turn into ????(question mark).
Please help to fix this.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Keep your theme language agnostic: Write all strings in English and use the proper translation functions to get the translated string (eg. Arabic):
_e( 'Hello world!', 'your_text_domain' );
<meta charset="<?php bloginfo("charset");?>" />
You shouldn't touch any php files in regards to this problem, the only time when you will do it is when you set the language for the blog, like this:
define ('WPLANG', 'ar');
In wp-config.php, make sure you have the following line (this is for the database, but it helps ensure everything is consistent):
Also you may want to switch your UI to arabic (however this is optional), but to do that, you can do change your language line in wp-admin to the following:
define( 'WPLANG', 'ar' );
Next, add the following code to appear in all your pages, a recommended spot of it is header.php
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo("charset") ?>"> <!-- The rest of your code goes here -->