198 | | $file = is_rtl() ? 'css/buddypress-rtl.css' : 'css/buddypress.css'; |
199 | | |
200 | | // Check child theme |
201 | | if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { |
202 | | $location = trailingslashit( get_stylesheet_directory_uri() ); |
203 | | $handle = 'bp-child-css'; |
204 | | |
205 | | // Check parent theme |
206 | | } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { |
207 | | $location = trailingslashit( get_template_directory_uri() ); |
208 | | $handle = 'bp-parent-css'; |
209 | | |
210 | | // BuddyPress Theme Compatibility |
| 198 | $file_name = is_rtl() ? 'buddypress-rtl.css' : 'buddypress.css'; |
| 199 | |
| 200 | // Check whether child theme or parent |
| 201 | $path = ( is_child_theme() )? trailingslashit( get_stylesheet_directory() ) : trailingslashit( get_template_directory() ); |
| 202 | $path_uri = ( is_child_theme() )? trailingslashit( get_stylesheet_directory_uri() ) : trailingslashit( get_template_directory_uri() ); |
| 203 | |
| 204 | // Check for 'buddypress/' in theme root |
| 205 | if ( file_exists( $path . 'buddypress/css/' . $file_name ) ) { |
| 206 | $location = $path_uri . 'buddypress/css/'; |
| 207 | $handle = ( is_child_theme() )? 'bp-child-css' : 'bp-parent-css'; |
| 208 | |
| 209 | // Check for 'community/' in theme root |
| 210 | } elseif ( file_exists( $path . 'community/css/' . $file_name ) ) { |
| 211 | $location = $path_uri . 'community/css/'; |
| 212 | $handle = ( is_child_theme() )? 'bp-child-css' : 'bp-parent-css'; |
| 213 | |
| 214 | // Check for 'css/' in theme root - in case themes already have this |
| 215 | } elseif ( file_exists( $path . 'css/' . $file_name ) ) { |
| 216 | $location = $path_uri . 'css/'; |
| 217 | $handle = ( is_child_theme() )? 'bp-child-css' : 'bp-parent-css'; |
| 218 | |
| 219 | // BuddyPress Theme Compatibility |