ليس لدى هذا المستخدم أي مواضيع مفضلة.
مواضيع المنتدى المفضلة
مواضيع المنتدى التي تم إنشاؤها
الحالة |
الموضوع
|
داعم | الأصوات | المشاركات | الحداثة |
---|---|---|---|---|---|
Switching to French causes a 404 error on home page and switching to Indonesian causes a critical wo…
بدأه: Tory Grice في: English Support |
|
0 | 2 | قبل 1 يوم، 19 ساعة | |
Function that adds a class to the body tag of each page based on the page slug is not working in tra…
بدأه: Tory Grice
في: English Support
Problem: function add_slug_body_class_wpml_fallback( $classes ) { $original_id = get_queried_object_id(); // Check if WPML is available if ( class_exists( 'sitepress' ) ) { $current_lang = apply_filters( 'wpml_current_language', null ); $translated_id = wpml_object_id( $original_id, 'page', true, $current_lang ); } else { $translated_id = $original_id; } // WPML logic continues if ( $translated_id ) { $post_type = get_post_type( $translated_id ); $post_slug = get_post_field( 'post_name', $translated_id ); if ( $post_type && $post_slug ) { $classes[] = $post_type . '-' . $post_slug; } } return $classes; } add_filter( 'body_class', 'add_slug_body_class_wpml_fallback' ); Before implementing this solution, ensure to back up your site and have FTP access ready as a precaution. This modification involves developer-level changes, which are usually beyond standard support scope. For more details on WPML's hooks, visit WPML Hooks Reference. If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Also, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum. |
|
0 | 2 | قبل 3 أسابيع، يومين |