コンテンツへスキップ サイドバーへスキップ

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.

返信を投稿

他の人に対してトピックに沿った礼儀正しい対応をお願いします。この投稿に関連しない問題についてサポートが必要な場合は、サポートフォーラムを使用してチャットを開始するか、チケットを送信してください。

次のタグが使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>