跳到内容 跳到侧边栏

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>