Skip to content

Instantly share code, notes, and snippets.

@vishnusomanus
Last active April 4, 2017 06:36
Show Gist options
  • Save vishnusomanus/5ef6142c14e466687a0971212b51e7e5 to your computer and use it in GitHub Desktop.
Save vishnusomanus/5ef6142c14e466687a0971212b51e7e5 to your computer and use it in GitHub Desktop.
Download wp plugin
............................................
https://wordpress.org/plugins/qtranslate-x/
header style sheet code
............................................
<?php
$lang='en';
$page='@';
$page_now=get_the_id();
$curLang = substr(get_bloginfo( 'language' ), 0, 2);
$home_url=get_home_url();
switch ($curLang) {
case "ar": $lang='ar'; ?>
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri () ?>/templateextras/bootstrap/css/bootstrap-rtl.min.css">
<?php
break;
default:$lang='en';
?>
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri () ?>/templateextras/bootstrap/css/bootstrap.css">
<?php
break;
}
?>
Language switch button
............................................
<?php dynamic_sidebar("lang_switch"); ?>
function.php
............................................
add sidebar with slug lang_switch
menu direction change css
............................................
direction: rtl;
to change custom css to arabic
............................................
https://cssjanus.github.io/
use bootstrap rtl css
change lang in php pages
............................................
<?php _e("<!--:en-->english here<!--:--><!--:ar-->arabic here<!--:-->"); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment