Bug: child theme on RTL-based WP
-
After uploading the Customizr’s example child theme (empty one) to my RTL WP site, my site broke. Apparently the reason is that the ltr blue.css file is processed instead of the one in “inc/css/rtl” one.
My conclusion is that the following code, found in “inc/class-fire-init.php“, is flawed:
/** * Returns the active path+skin.css * * @package Customizr * @since Customizr 3.0.15 */ function tc_active_skin() { $skin = esc_attr( tc__f( '__get_option' , 'tc_skin' ) ); //Finds the good path : are we in a child theme and is there a skin to override? $remote_path = false; $remote_path = ( TC___::$instance -> tc_is_child() && file_exists(TC_BASE_CHILD .'inc/css/' . $skin) ) ? TC_BASE_URL_CHILD .'inc/css/' : $remote_path ; $remote_path = ( !$remote_path && file_exists(TC_BASE .'inc/css/' . $skin) ) ? TC_BASE_URL .'inc/css/' : $remote_path ; //Checks if there is a rtl version of the selected skin if needed if ('ar' == WPLANG || 'he_IL' == WPLANG) { $remote_path = ( TC___::$instance -> tc_is_child() && file_exists(TC_BASE_CHILD .'inc/css/rtl/' . $skin) ) ? TC_BASE_URL_CHILD .'inc/css/rtl/' : $remote_path ; $remote_path = ( !TC___::$instance -> tc_is_child() && file_exists(TC_BASE .'inc/css/rtl/' . $skin) ) ? TC_BASE_URL .'inc/css/rtl/' : $remote_path ; } //Defines the active skin and fallback to blue.css if needed $tc_active_skin = $remote_path ? $remote_path.$skin : TC_BASE_URL.'inc/css/blue.css'; return apply_filters ( 'tc_active_skin' , $tc_active_skin ); }
The code above will try and find the RTL skin .css file in the child theme, instead of the original customizr.
My current solution is a hacky one – I simply created a “inc/css/rtl” folder in the child theme, and imported all css files, including fonts and font folders.
This obvious problem with this solution is that after a Customizr upgrade, those copied css files won’t be updated.
I’m open to suggestions… thanks:)
- The topic ‘Bug: child theme on RTL-based WP’ is closed to new replies.