i this i fixed the issue by updating the code to this
add_filter( 'locale', 'penci_set_frontend_locale' ); function penci_set_frontend_locale( $locale ) { // check if you are in the Admin area if( ! is_admin() ) { // set LTR locale $locale = 'ar'; } return $locale; } add_filter('body_class', 'penci_set_frontend_locale_class'); function penci_set_frontend_locale_class($classes) { $classes[] = 'rtl';
This issue caused by you've moved all that code to plugin. That make RTL style enque above the theme style and make the site broken. I just change the code on your plugin to:
// change backend to LTR and frontend to RTL
add_filter('body_class', 'penci_set_frontend_locale_class');
function penci_set_frontend_locale_class($classes) {
if( ! is_admin() ) {
$classes[] = 'rtl';
}
return $classes;
}
add_filter( 'language_attributes', 'penci_add_language_attributes' );
function penci_add_language_attributes($output) {
if( ! is_admin() ) {
return $output = 'dir="rtl" ' . $output;
}
return $output;
}
// change backend to LTR and frontend to RTL
Hi, i would like to enable RTL mode in only front end of the site.
im pasting this code in last line of functions.php but something else is overriding it.
Please kindly help me on this
Hi,
You can use this plugin to do that.
Best Regards,
PenciDesign
hi, i think this will only allow me to switch a specific page. as my blog is a multi author blog, i want all admin pages to be in english and LTR.
Hi,
Please send me your admin url and admin account ( username and password ) in a private reply. I will take it a look on this.
Best Regards,
PenciDesign
hi i have tested the code. its making the front end the way i want, but its up the backend,
see attached image. also please login to site and check back end
i this i fixed the issue by updating the code to this
Hi,
I've fixed it help you by change the code to:
Best Regards,
PenciDesign
right now im facing another issue.
the language of front end is Arabic now.
I actually dont want it to be in arabic. just want it to be in RTL because ill be using a customer language.
so it should be in english but RTL;
Hi,
If so, please try replace the code I sent you before to this code:
Best Regards,
PenciDesign
its breaking some part of the frontend now..
Hi,
This issue caused by you've moved all that code to plugin. That make RTL style enque above the theme style and make the site broken. I just change the code on your plugin to:
And add more this code to functions.php file - check this image: http://prntscr.com/l77ia6
Best Regards,
PenciDesign
is there any way to do this without editing a theme file? so that i dont have to remember what i edited when updating the theme
Hi,
If you want to do that, please use child theme.
You can use plugin Customizer Export/Import to move customization data to child theme.
And copy the codes in rtl.css and add more that codes to style.css file of child theme file
Best Regards,
PenciDesign