Automated script that changed LTR to RTL

I would like to try an automated script that will change LTR WordPress themes to RTL WordPress theme. Basically, I want to change “left” to “right” and “right” to “left” in the theme’s style.css file; I’ve tried to do str_replace() the word “left” to “right” and the opposite, but after it changes “left” to “right”, it changes it back to “left” after I execute the second str_replace().

Any ideas?

Related posts

Leave a Reply

1 comment

  1. As I am working with Bilingual wordpress I can suggest you to use qTranslate plugin.

    And then you can switch themes with following:

            <?php if (qtrans_getLanguage() == 'ar'): #use your own language name here. ?>
            <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri() . "/style_rtl.css"; ?>" />
            <?php else: ?>
            <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>">
            <?php endif; ?>