- Stato
- Risolto dall’autore
- Plugin/tema correlato
- Salient
- Tag dell’argomento
- Compatibility
Panoramica del problema
Quando usi il tema Salient con WPML e WooCommerce, l’immagine dell’intestazione della categoria non appare nelle pagine delle categorie di prodotto tradotte. Questo accade perché l’immagine assegnata alla categoria originale non viene copiata o visualizzata automaticamente per le traduzioni.
Soluzione alternativa
Assicurati di avere un backup completo del tuo sito prima di procedere.
- Apri il file …wp-content/themes/salient/nectar/helpers/page-header.php.
- Cerca la riga 151.
- Sostituisci:
// Woocommerce archives. if( is_product_category() || is_product_tag() || is_product_taxonomy() ) { $subtitle = ''; $title = woocommerce_page_title(false); $cate = get_queried_object(); $t_id = (property_exists($cate, 'term_id')) ? $cate->term_id : ''; $product_terms = get_option( "taxonomy_$t_id" ); $bg = (!empty($product_terms['product_category_image'])) ? $product_terms['product_category_image'] : $bg;
- Con:
// Woocommerce archives. if( is_product_category() || is_product_tag() || is_product_taxonomy() ) { $subtitle = ''; $title = woocommerce_page_title(false); $cate = get_queried_object(); $t_id = (property_exists($cate, 'term_id')) ? $cate->term_id : ''; // WPML Workaround for compsupp-7882 if ( class_exists('Sitepress') ) { $default_lang = apply_filters('wpml_default_language', NULL ); $t_id = apply_filters( 'wpml_object_id', $t_id, $cate->taxonomy, TRUE, $default_lang ); } $product_terms = get_option( "taxonomy_$t_id" ); $bg = (!empty($product_terms['product_category_image'])) ? $product_terms['product_category_image'] : $bg;