WPML
סטטוס
פתוח
תוסף/ערכת עיצוב קשורים
Header Footer Code Manager
תגיות נושא
Compatibility

סקירה כללית של התקלה

בעת שימוש בתוסף Header Footer Code Manager כדי להוסיף קטעי קוד לעמודים מסוימים, תנאי התצוגה אינם מוחלים כראוי על עמודים מתורגמים בעת שימוש ב־WPML. כתוצאה מכך, קטעי הקוד חסרים בגרסאות המתורגמות של העמודים.

פתרון עוקף

אנא ודא שיש ברשותך גיבוי מלא של האתר לפני שתמשיך.


  • פתח את הקובץ …/wp-content/plugins/header-footer-code-manager/99robots-header-footer-code-manager.php

  • חפש את שורה 550.

  • החלף את:
    case 's_pages':
        $is_not_empty_s_pages = self::hfcm_not_empty( $scriptdata, 's_pages' );
        if ( $is_not_empty_s_pages ) {
            // Gets the page ID of the blog page
            $blog_page = get_option( 'page_for_posts' );
            // Checks if the blog page is present in the array of selected pages
            if ( in_array( $blog_page, json_decode( $scriptdata->s_pages ) ) ) {
                if ( is_page( json_decode( $scriptdata->s_pages ) ) || (!is_front_page() && is_home()) ) {
                    $out = self::hfcm_render_snippet( $scriptdata );
                }
            } elseif ( is_page( json_decode( $scriptdata->s_pages ) ) ) {
                $out = self::hfcm_render_snippet( $scriptdata );
            }
        }
        break;
            


  • ב:
    case 's_pages':
        $is_not_empty_s_pages = self::hfcm_not_empty( $scriptdata, 's_pages' );
        if ( $is_not_empty_s_pages ) {
            // WPML workaround for compsupp-7802
            $original_ids = json_decode( $scriptdata->s_pages);
            foreach ( $original_ids as $original_id ) {
                $translated_ids[] = apply_filters( 'wpml_object_id', $original_id, 'page');
                }
            // Gets the page ID of the blog page
            $blog_page = get_option( 'page_for_posts' );
            // Checks if the blog page is present in the array of selected pages
            if ( in_array( $blog_page, json_decode( $scriptdata->s_pages ) ) ) {
                if ( is_page( $translated_ids ) || (!is_front_page() && is_home()) ) {
                    $out = self::hfcm_render_snippet( $scriptdata );
                }
            } elseif ( is_page( $translated_ids ) ) {
                $out = self::hfcm_render_snippet( $scriptdata );
            }
        }
        break;
            

כל התקלות הידועות →