탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

When using the ColorMag theme with WPML, the colors assigned to categories in Appearance → Customize → Global → Category Colors are only applied to the default language.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open: /wp-content/themes/colormag/inc/template-tags.php
  • Look for line 141
  • Replace:
    foreach ( $category as $category_list ) {
    
                $color = get_theme_mod( 'colormag_category_color_' . $wp_category_id );
    
                return $color;
    
            }
    
  • With:
    foreach ( $category as $category_list ) {
    
                // WPML workaround for compsupp-7690 
                $my_default_lang = apply_filters('wpml_default_language', NULL );
                $wp_category_id = apply_filters( 'wpml_object_id', $wp_category_id, 'category', TRUE, $my_default_lang );
    
                $color = get_theme_mod( 'colormag_category_color_' . $wp_category_id );
    
                return $color;
    
            } 
    

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>