• hi i need to solve this problem
    I want to fix the orientation of the text when writing posts in WordPress in Arabic
    What should I do to enable writing in Arabic in the writing board in WordPress?
    I also use wordpress in the English language, but most articles are in Arabic, which causes wasting a lot of time.

Viewing 1 replies (of 1 total)
  • Hi, @thehospitalegy

    I assume you want to use WordPress Dashboard in English intentionally? If you change the Dashboard language to Arabic, the entire Dashboard will be rtl. (& site as well if your theme has a rtl stylesheet).

    If you don’t want to change your language, you could use this PHP snippet in your theme (ideally child theme – so it won’t vanish when the theme gets an update) functions.php file.

    This is only briefly tested and experimental so make sure you have a backup before testing yourself.

    add_filter('locale', 'rtl_when_editing');
    function rtl_when_editing () {
    	global $pagenow;
    	if( is_admin() && ( $pagenow == 'post.php' || $pagenow == 'post-new.php' ) ) {
    		global $wp_locale;
    		$wp_locale->text_direction = 'rtl';
    	}
    }

    This changes the page orientation to rtl when editing posts & pages and when adding new posts & pages.

    Hope this helps,
    Kind regards!

Viewing 1 replies (of 1 total)

The topic ‘rtl in write box’ is closed to new replies.