이 사용자는 즐겨찾는 주제가 없습니다.
즐겨찾는 포럼 주제
생성한 포럼 주제
상태 |
주제
|
후원자 | 의견 | 게시물 | 최신 |
---|---|---|---|---|---|
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 주, 2 일 전에 |