0
votes

today I have a problem with front page section in wordpress.

I use polylang and when I change language on the page, my page uses bad language (the default language).

For example: My default language is polish language, for polish user, I show text:

Kontakt

When I change language for English I can see:

Contact

but at the moment I see the bad result and I can see:

Kontakt

I use template Twenty Seventeen, polylang.

Thank you in advance for all reply.

1

1 Answers

0
votes

I did it. I edited file

template/inc/template-tags.php

and at the moment my *_front_page_section in the file it looks like this

function acousticquartet_front_page_section( $partial = null, $id = 0 ) {
    if ( is_a( $partial, 'WP_Customize_Partial' ) ) {
        // Find out the id and set it up during a selective refresh.
        global $acousticquartetcounter;
        $id = str_replace( 'panel_', '', $partial->id );
        $acousticquartetcounter = $id;
    }

    global $post; // Modify the global post object before setting up post data.
    if ( get_theme_mod( 'panel_' . $id ) ) {
        global $post;

        if(pll_get_post(get_theme_mod( 'panel_' . $id ))):
            $id = pll_get_post($id = get_theme_mod( 'panel_' . $id ));
        else:
            $id = get_theme_mod( 'panel_' . $id );
        endif;

        $post = get_post( $id );
        setup_postdata( $post );
        set_query_var( 'panel', $id );

        get_template_part( 'template-parts/page/content', 'front-page-panels' );

        wp_reset_postdata();
    } elseif ( is_customize_preview() ) {
        // The output placeholder anchor.
        echo '<article class="panel-placeholder panel acousticquartet-panel acousticquartet-panel' . $id . '" id="panel' . $id . '"><span class="acousticquartet-panel-title">' . sprintf( __( 'Front Page Section %1$s Placeholder', 'acousticquartet' ), $id ) . '</span></article>';
    }
}

And when I don't have translate, my code show default language.