- Statut
- Résolu par l’auteur
- Extension/thème associé
- Salient
- Étiquettes de sujet
- Compatibility
Aperçu de l’anomalie
Lors de l’utilisation du thème Salient avec WPML et WooCommerce, l’image d’en-tête de la catégorie n’apparaît pas sur les pages de catégories de produits traduites. Cela est dû au fait que l’image attribuée à la catégorie d’origine n’est pas automatiquement copiée ni affichée pour les traductions.
Solution de contournement
Assurez-vous de disposer d’une sauvegarde complète de votre site avant de continuer.
- Ouvrez le fichier …wp-content/themes/salient/nectar/helpers/page-header.php.
- Cherchez la ligne 151.
- Remplacez :
// 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;
- Par :
// 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;