Chuyển đến nội dung Chuyển đến thanh bên

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using Kadence theme with the Kadence PRO plugin, templates assigned to WooCommerce product category archives may not be applied correctly to their translated versions.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

1. Template Rendering Fix

  • Open the …/wp-content/plugins/kadence-pro/dist/elements/elements-init.php file.
  • Look for line 2035.
  • Replace:
    if ( in_array( $queried_obj->term_id, $show_taxs ) ) {
            
  • With:
    if ( defined( 'WPML_PLUGIN_FILE' ) ) {
    	$my_default_lang = apply_filters( 'wpml_default_language', NULL );
    	$queried_obj->term_id = apply_filters( 'wpml_object_id', $queried_obj->term_id, $queried_obj->taxonomy, true, $my_default_lang ); 
    }
    if ( in_array( $queried_obj->term_id, $show_taxs ) ) {
            

 

2. Post ID Translation Fix

  • In the same file, look for line 2018.
  • Replace:
    $current_id = get_the_ID();
            
  • With:
    $current_id = get_the_ID();
    if ( defined( 'WPML_PLUGIN_FILE' ) ) {
    	$my_default_lang = apply_filters( 'wpml_default_language', NULL );
    	$current_id = apply_filters( 'wpml_object_id', $current_id, 'post', true, $my_default_lang );
    }
            

 

3. Conditional Header Template Fix

The same issue occurs with conditional headers, where they are not applied to translated versions of content.

  • Open the …/wp-content/plugins/kadence-pro/dist/conditional-headers.php file.
  • Look for line 1287.
  • Apply the same change as done in Point #1, on line 2035 of the previous file.

Để lại trả lời

Vui lòng giữ đúng chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi vé hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>