Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 3 replies, has 0 voices.

Last updated by Itamar 3 weeks, 3 days ago.

Assisted by: Itamar.

Author Posts
October 12, 2025 at 6:21 pm #17477720

ehaitech-marketing-consultant-

I have 2 questions to ask:

1. After the website is translated, the visual effect of the website becomes worse.
Header codes:
<?php
/**
* The header for Astra Theme.
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Astra
* @since 1.0.0
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

?><!DOCTYPE html>
<?php astra_html_before(); ?>
<html <?php language_attributes(); ?>>
<head>

<?php astra_head_top(); ?>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
if ( apply_filters( 'astra_header_profile_gmpg_link', true ) ) {
?>
<link rel="profile" href="hidden link">
<?php
}
?>
<?php wp_head(); ?>
<?php astra_head_bottom(); ?>

<!--自定义-->
<!--<link rel="stylesheet" href="static/css/swiper-bundle.min.css">-->
<link rel="stylesheet" href="<?php echo HX_T_DIR?>static/css/style.css">
<link rel="stylesheet" href="<?php echo HX_T_DIR?>static/css/media.css">

<script src="<?php echo HX_T_DIR?>static/js/jquery-3.6.0.js"></script>
<!--<script src="<?php echo HX_T_DIR?>static/js/swiper-bundle.min.js"></script>-->
<script src="<?php echo HX_T_DIR?>static/js/option.js"></script>
<!--自定义end-->
</head>

<body <?php astra_schema_body(); ?> <?php body_class(); ?>>

<header>
<div class="head_out">
<div class="head">
<div class="top head_width">
<!-- 1752px-->
<div class="lan current">
<div class="item">
<img class="earth" src="<?php echo HX_T_DIR?>static/img/earth.png" alt="">
EN
<img class="select set_select" src="<?php echo HX_T_DIR?>static/img/down.png" alt="">
<div class="other_len set_other_len">

</div>
</div>
<div class="module">
<div class="list"></div>
</div>
</div>
<div id="langs_chajian">

</div>
<div class="out_line">

</div>
</div>
<div class="line"></div>
<div class="bot head_width">
<div class="logo">
">



</div>
<div class="nav">
<!-- 1142px-->

    <!-- 1008px-->
    <?php
    $menu_locations = get_nav_menu_locations();
    $primary_menu_id = $menu_locations['primary'];
    $menu_object = wp_get_nav_menu_object($primary_menu_id);
    $topMenus = wp_get_nav_menu_items($menu_object->term_id);

    if ($topMenus){
    foreach ( $topMenus as $_headOne ){
    if ( $_headOne->menu_item_parent ==0 ){
    ?>

  • <div class="drop">
    url?>">title?>
    <?php
    if (has_son_menu($topMenus,$_headOne->ID)){
    ?>

    <?php } ?>

    </div>
    <?php
    //产品类型的下拉
    if ($_headOne->object == 'product_cat'){
    ?>
    <div class="down">
    <!-- 867px-->
    <div class="module">
    <div class="list_out">
    <!-- 262px-->
    <div class="inner">
    <?php
    $num=0;
    foreach ( $topMenus as $_headTwo ){
    if ( $_headTwo->menu_item_parent == $_headOne->ID){
    ?>
    <div class="list set_man_1" data-num="<?php echo $num ?>">
    url.'?_product='.basename(parse_url($_headTwo->url,PHP_URL_PATH))?>">title?>
    </div>
    <?php
    $num++;
    }
    }
    ?>
    </div>
    <div class="bot_a">
    url?>">View Products >>
    </div>
    </div>

    <?php
    //获取产品属性值 ACF后台属性值
    $args = array(
    'limit' => 1,
    'orderby' => 'date',
    'order' => 'DESC',
    );
    $products = wc_get_products($args);
    $latest_product = current($products);
    $latest_product_id = $latest_product->get_id();
    $fieldsType = get_field_object('shuxing', $latest_product_id);
    $acfFiledsArr = $fieldsType['choices'];
    $middleMenuArr = [];

    $isFilter = isFilterQuery($_headOne->object_id,$acfFiledsArr);
    ?>

    <?php include __DIR__.'/headFilter.php'; ?>

    <?php include __DIR__.'/headOther.php'; ?>
    </div>
    </div>
    <?php
    //产品类型的下拉 end
    }
    ?>

    <?php
    //其他下拉
    if (has_son_menu($topMenus,$_headOne->ID) && ($_headOne->object != 'product_cat')){
    ?>
    <div class="down" data-name="about">
    <!-- 867px-->
    <div class="module">
    <div class="list_out">
    <!-- 262px-->
    <div class="inner">

    <?php
    foreach ( $topMenus as $_headOtherTwo ){
    if ( $_headOtherTwo->menu_item_parent == $_headOne->ID){

    ?>
    <div class="list">
    url?>">title?>
    </div>

    <?php }} ?>

    </div>

    </div>

    </div>
    </div>
    <?php }

    //其他下拉 end
    ?>

  • <?php } }
    } ?>

   
<div class="search set_home_search">
<img src="<?php echo HX_T_DIR?>static/img/search.png" alt="">
</div>
</div>
<div class="menu set_menu">
<img src="<?php echo HX_T_DIR?>static/img/menu.png" alt="">
</div>
</div>
</div>

<div class="head_search ">
<div class="search_top">
<form action="<?php bloginfo('url'); ?>" method="get">
<div class="inner">
<input type="text" name="s" placeholder="Search">
<button><img src="<?php echo HX_T_DIR ?>static/img/search.png" alt=""></button>
</div>
</form>
<div class="search_close set_search_close">
<img src="<?php echo HX_T_DIR ?>static/img/close.png" alt="">
</div>
</div>
</div>
<div class="phone_head">
<div class="close set_close ">
<p>Menu</p>
<img src="<?php echo HX_T_DIR?>static/img/close.png" alt="">
</div>
<div class="module">

</div>
</div>
</div>
</header>

<?php astra_body_top(); ?>
<?php wp_body_open(); ?>

<a
class="skip-link screen-reader-text"
href="#content"
role="link"
title="<?php echo esc_attr( astra_default_strings( 'string-header-skip-link', false ) ); ?>">
<?php echo esc_html( astra_default_strings( 'string-header-skip-link', false ) ); ?>

<div
<?php
echo astra_attr(
'site',
array(
'id' => 'page',
'class' => 'hfeed site',
)
);
?>
>
<?php
astra_header_before();

astra_header();

astra_header_after();

astra_content_before();
?>
<div id="content" class="site-content">
<div class="ast-container">
<?php astra_content_top(); ?>

2. The astra theme of 4.1.6 has a second version problem. Our customized code will have bugs when it encounters wpml.
Bug Problems:
2025/10/09 09:38:18 [error] 3708449#3708449: *33995351 FastCGI sent in stderr: "PHP message: Connection refusedPHP message: PHP Fatal error: Uncaught Error: Call to a member function get_id() on bool in /var/www/xintaiceshi/wp-content/themes/astra/header.php:169
Stack trace:
#0 /var/www/xintaiceshi/wp-includes/template.php(783): require_once()
#1 /var/www/xintaiceshi/wp-includes/template.php(718): load_template()
#2 /var/www/xintaiceshi/wp-includes/general-template.php(48): locate_template()
#3 /var/www/xintaiceshi/wp-content/themes/astra/page.php(20): get_header()
#4 /var/www/xintaiceshi/wp-includes/template-loader.php(106): include('/var/www/xintai...')
#5 /var/www/xintaiceshi/wp-blog-header.php(19): require_once('/var/www/xintai...')
#6 /var/www/xintaiceshi/index.php(17): require('/var/www/xintai...')
#7 {main}
thrown in /var/www/xintaiceshi/wp-content/themes/astra/header.php on line 169" while reading response header from upstream, client: 113.66.116.232, server: xintaikejizh.yhct.top, request: "GET /%e5%85%b3%e4%ba%8e-ledman HTTP/2.0", upstream: "hidden link:", host: "xintaikejizh.yhct.top", referrer: "hidden link"

October 12, 2025 at 6:32 pm #17477727

Itamar
WPML Supporter since 02/2016

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

In this ticket, I'll continue to help you with problem number 1 (After the website is translated, the visual effect of the website becomes worse.) Please open a new ticket with problem number 2.

I'm sorry, but I'm unable to make sense of the code you shared.
Where can I see this problem with the header on your site?
Could you please share screenshots of this problem with me?

Regards,
Itamar.

October 13, 2025 at 2:41 am #17478109

ehaitech-marketing-consultant-

Our website themes are customized such as: 4.1.6 astra. However, after installing the wpml plug-in and using it, bugs will occur when the customized code encounters wpml. How to solve

Bug code:
2025/10/09 09:38:18 [error] 3708449#3708449: *33995351 FastCGI sent in stderr: "PHP message: Connection refusedPHP message: PHP Fatal error: Uncaught Error: Call to a member function get_id() on bool in /var/www/xintaiceshi/wp-content/themes/astra/header.php:169
Stack trace:
#0 /var/www/xintaiceshi/wp-includes/template.php(783): require_once()
#1 /var/www/xintaiceshi/wp-includes/template.php(718): load_template()
#2 /var/www/xintaiceshi/wp-includes/general-template.php(48): locate_template()
#3 /var/www/xintaiceshi/wp-content/themes/astra/page.php(20): get_header()
#4 /var/www/xintaiceshi/wp-includes/template-loader.php(106): include('/var/www/xintai...')
#5 /var/www/xintaiceshi/wp-blog-header.php(19): require_once('/var/www/xintai...')
#6 /var/www/xintaiceshi/index.php(17): require('/var/www/xintai...')
#7 {main}
thrown in /var/www/xintaiceshi/wp-content/themes/astra/header.php on line 169" while reading response header from upstream, client: 113.66.116.232, server: xintaikejizh.yhct.top, request: "GET /%e5%85%b3%e4%ba%8e-ledman HTTP/2.0", upstream: "hidden link:", host: "xintaikejizh.yhct.top", referrer: "hidden link"

October 13, 2025 at 1:52 pm #17480027

Itamar
WPML Supporter since 02/2016

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'm sorry, but we can't support old versions of the Astra theme. The version you are using (4.1.6) was released on July 5, 2023. It is more than two years old: hidden link
We cannot assist with any issues that occur with this old Astra version and WPML.

The same applies to the WordPress version. You are using WordPress version 6.2.2, which was released over two years ago: https://wordpress.org/documentation/wordpress-version/version-6-2-2/.

We will be happy to investigate any issues you may have with the latest version of WordPress and the Astra theme.

Please consider updating your site's WordPress and Astra versions to the latest versions. Then, if you have issues, we will investigate them.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Regards,
Itamar.