Question

In wordpress, inside the header.php file of a theme, there is the next line:

<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

By default, it(language_attributes) returns dir=ltr, and every online guide i read tried to show a way to hange the css file.

it's not enough and not semantic. i need to change the html itself to rtl. how can it be done? is there a settings file?

Was it helpful?

Solution

The best way to edit your default language is through the wp-config.php file on the root directory.

This case should be for Spanish of Spain define ('WPLANG', 'es_ES');

This one to the USA English define ('WPLANG', 'en_US');

You have all the possible combinations at this page: http://xml.coverpages.org/iso639a.html

Regards

OTHER TIPS

You can control the text direction via the language files. If you download the Arabic(an RTL langauge) Wordpress for example. You'll find this value is set in the \wp-content\languages\ar.php as:

$text_direction = 'rtl';

And to enable it..you need to set the WPLANG variable in your wp-config to the RTL language like this:

define ('WPLANG', 'ar');

Then your language_attributes() will output the dir='rtl' you want.

Take a look at the following two links. You need to ensure both of your theme and WordPress are setup for RTL.

http://codex.wordpress.org/Right_to_Left_Language_Support

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

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