Pular para o conteúdo Pular para a barra lateral

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.

Deixe uma resposta

Por favor mantenha-se no assunto e seja respeitoso com os outros. Se precisar de ajuda com problemas não relacionados a este post, use nosso Fórum de Suporte para iniciar um chat ou enviar um ticket.

Você pode usar estas tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>