• Resolved kok4ik1

    (@kok4ik1)


    Hello!

    I have encountered an issue on my website, which uses AMP and the Polylang plugin for multilingual functionality. On the second language, the site does not recognize the homepage in the AMP version, resulting in a blank page being displayed. On the default language, everything works correctly.

    I am using the following function to connect AMP templates:

    //amp
    function mytheme_amp_template( $template ) {
    if ( function_exists( ‘is_amp_endpoint’ ) && is_amp_endpoint() ) {
    if ( is_home() || is_front_page() ) {
    $template = get_stylesheet_directory() . ‘/home-amp.php’;
    } elseif ( is_page_template( ‘home.php’ ) ) {
    $template = get_stylesheet_directory() . ‘/home-amp.php’;
    } elseif ( is_page_template( ‘onas.php’ ) ) {
    $template = get_stylesheet_directory() . ‘/onas-amp.php’;
    }
    }
    return $template;
    }
    add_filter( ‘template_include’, ‘mytheme_amp_template’, 10 );

    The issue arises specifically when trying to load the homepage in the alternative language. The page is not recognized and loads as blank. In the default language, the site works correctly, and AMP pages are displayed as expected.

    Support UUID: ampwp-14124c16-91b1-5fd5-8e79-975c0cc13512

    Please help me resolve this issue.

    Thank you in advance for your assistance!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with AMP and Polylang’ is closed to new replies.