-
AuthorPosts
-
March 8, 2018 at 5:58 pm #923972
I’ve build many RTL WordPress site with Enfold because it’s by far the best theme I know
not too long ago Enfold’s amazing support helped me improving enfold’s RTL compatibility on the admin side with this simple code snippet (https://kriesi.at/support/topic/reverse-columns-order-on-rtl-site/#post-889453) and it’s great!
here is the codeadd_action('admin_head', 'rtl_columns_fix_css'); function rtl_columns_fix_css() { $output = "<style>.avia_layout_column, .avia_layout_section, .avia-highlight { float: right !important; }</style>"; echo $output; }
and it works wonderfully on RTL sites
BUT on multilingual sites i’m building (with the WPML plugin) it becomes problematic because it affects all pages in the admin side, even pages set by the plugin to English (or any other LTR languages)
so my only question is: is there a way, on multilingual sites, to use this code but to limit it so it will effect only admin editing screens of RTL language pages and not all the edit screens?thanks in advance
Doron- This topic was modified 6 years, 8 months ago by Doron. Reason: typo
March 9, 2018 at 9:16 pm #924735Hey Doron,
Please add
add_action('admin_head', 'rtl_columns_fix_css'); function rtl_columns_fix_css() { if ( is_rtl() ) { $output = "<style>.avia_layout_column, .avia_layout_section, .avia-highlight { float: right !important; }</style>"; echo $output; } }
so that code can go ahead only on RTL! ;-)
Best regards,
BasilisMarch 10, 2018 at 11:20 pm #925092Hi Basilis
I’m afraid It’s not working
even with your new code still the layout (in the editing screen on the admin side) of English pages is flipped (and not just the Arabic or Hebrew which are RTL)may be the detection (of whether the edit screen is for RTL or LTR content) should be done by detecting WPML’s language settings for that editing page?
lets say, only if the values “he” or “ar” or “fa” is defined as “selected” in the “icl_post_language” than the code should work
but I don’t know how to write that kind of “if” in PHP syntax
could it be done?March 13, 2018 at 4:01 pm #926124UPDATE:
solved!
i consulted WPML support and they gave me the following ‘if’ code which seems to work perfectly:if( is_rtl() && in_array( ICL_LANGUAGE_CODE, array( "he", "ar", "fa" ) ) ) { // rtl code }
so you can close this thread
and again thank you very much for all the help
:)March 14, 2018 at 5:14 am #926385 -
AuthorPosts
- You must be logged in to reply to this topic.