Skip to content Skip to sidebar

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.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>