Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Osama Mersal 6 months, 3 weeks ago.

Assisted by: Osama Mersal.

Author Posts
September 13, 2024 at 12:28 pm

Megi Shehaj

Background of the issue:
Hello,

I am attempting to manually translate the header and footer from English to Albanian using WordPress editor.

I followed the steps of duplicating the page, translating it independently, and making the necessary changes to the translation.

However, now checking the English site, only the Albanian version of the templates appear on my site, even when I switch between languages.

I am using the WPResidence Studio Templates plugin from my theme, which integrates with Elementor to create the header and footer.

Let me know if you require anything else.

September 13, 2024 at 1:25 pm
September 15, 2024 at 10:35 am #16179750

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

First of all, sorry for the late reply; it was due to a higher workload.

1) I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:

/* Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M');

Best regards,
Osama

September 16, 2024 at 9:26 am
September 16, 2024 at 11:33 am #16183339

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for the access details. I installed a local copy of your site to debug the issue further and tried some workarounds with no luck.

It could be a compatibility issue, so please log in to hidden link">this sandbox site and install your theme.

After that, please create a test footer and translate it to replicate the issue. If the issue is replicable, please let me know to consult our compatibility team.

Best regards,
Osama

September 16, 2024 at 3:14 pm #16184762

Megi Shehaj

Hello,
I am unable to install the theme on the sandbox account as the license code is restricted to a single domain and is currently active on my production website.

September 16, 2024 at 3:32 pm #16184811

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I was able to replicate the issue without activating the theme. Please check if the issue on the sandbox is the same issue you face on your site.

Best regards,
Osama

September 17, 2024 at 7:44 am #16186442

Megi Shehaj

Hi,
Yes, the issue is the same. Even when I switch language the translation is still the same. It stays as the second translation, in this case in albanian.

September 17, 2024 at 7:54 am #16186681

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your reply. I'll consult our compatibility team regarding this issue and update you as soon as they reply.

Best regards,
Osama

September 17, 2024 at 3:35 pm #16189691

Megi Shehaj

Hi,

Thank you for your update. I will be awaiting your response and hope that your compatibility team is able to find a solution soon.

Best regards,
Megi

September 18, 2024 at 10:19 am #16192303

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Megi,

Thanks for your patience. Please check the following steps:

1- Open the app/public/wp-content/plugins/residence-studio/includes/class-header-footer-templates.php file
2- Around line 21, replace the following snippet (display_custom_elementor_header and display_custom_elementor_footer methods):

public function display_custom_elementor_header() {
    $first_before_header_key = array_search('wpestate_template_before_header', $this->header_footer_templates);
    $wpestate_template_header = array_search('wpestate_template_header', $this->header_footer_templates);
    $wpestate_template_after_header = array_search('wpestate_template_after_header', $this->header_footer_templates);

    echo '<div class="wpestate_elementor_header_custom">';
    if ($first_before_header_key !== false) {
        $this->render_elementor_post($first_before_header_key);
    }
    if ($wpestate_template_header !== false) {
        $this->render_elementor_post($wpestate_template_header);
    }
    if ($wpestate_template_after_header !== false) {
        $this->render_elementor_post($wpestate_template_after_header);
    }
    echo '</div>';
}

/**
 * Display custom Elementor footer
 */
public function display_custom_elementor_footer() {
    $first_before_footer_key        = array_search('wpestate_template_before_footer', $this->header_footer_templates);
    $wpestate_template_footer       = array_search('wpestate_template_footer', $this->header_footer_templates);
    $wpestate_template_after_footer = array_search('wpestate_template_after_footer', $this->header_footer_templates);

    echo '<div class="wpestate_elementor_footer_custom">';
        if ($first_before_footer_key !== false) {
            $this->render_elementor_post($first_before_footer_key);
        }
        if ($wpestate_template_footer !== false) {
            $this->render_elementor_post($wpestate_template_footer);
        }
        if ($wpestate_template_after_footer !== false) {
            $this->render_elementor_post($wpestate_template_after_footer);
        }
    echo '</div>';
}

With:

/**
 * Display custom Elementor header
 */
public function display_custom_elementor_header() {
    $first_before_header_key = array_search('wpestate_template_before_header', $this->header_footer_templates);
    $wpestate_template_header = array_search('wpestate_template_header', $this->header_footer_templates);
    $wpestate_template_after_header = array_search('wpestate_template_after_header', $this->header_footer_templates);

    echo '<div class="wpestate_elementor_header_custom">';
    if ($first_before_header_key !== false) {
        $first_before_header_key = apply_filters('wpml_object_id', $first_before_header_key, get_post_type($first_before_header_key), true);
        $this->render_elementor_post($first_before_header_key);
    }
    if ($wpestate_template_header !== false) {
        $wpestate_template_header = apply_filters('wpml_object_id', $wpestate_template_header, get_post_type($wpestate_template_header), true);
        $this->render_elementor_post($wpestate_template_header);
    }
    if ($wpestate_template_after_header !== false) {
        $wpestate_template_after_header = apply_filters('wpml_object_id', $wpestate_template_after_header, get_post_type($wpestate_template_after_header), true);
        $this->render_elementor_post($wpestate_template_after_header);
    }
    echo '</div>';
}


/**
 * Display custom Elementor footer
 */
public function display_custom_elementor_footer() {
    $first_before_footer_key        = array_search('wpestate_template_before_footer', $this->header_footer_templates);
    $wpestate_template_footer       = array_search('wpestate_template_footer', $this->header_footer_templates);
    $wpestate_template_after_footer = array_search('wpestate_template_after_footer', $this->header_footer_templates);

    echo '<div class="wpestate_elementor_footer_custom">';
        if ($first_before_footer_key !== false) {
            $first_before_footer_key = apply_filters('wpml_object_id', $first_before_footer_key, get_post_type($first_before_footer_key), true);
            $this->render_elementor_post($first_before_footer_key);
        }
        if ($wpestate_template_footer !== false) {
            $wpestate_template_footer = apply_filters('wpml_object_id', $wpestate_template_footer, get_post_type($wpestate_template_footer), true);
            $this->render_elementor_post($wpestate_template_footer);
        }
        if ($wpestate_template_after_footer !== false) {
            $wpestate_template_after_footer = apply_filters('wpml_object_id', $wpestate_template_after_footer, get_post_type($wpestate_template_after_footer), true);
            $this->render_elementor_post($wpestate_template_after_footer);
        }
    echo '</div>';
}

I've applied these steps to the sandbox site. Please check if it works correctly. (hidden link)

Best regards,
Osama

The topic ‘[Closed] Header and Footer translation’ is closed to new replies.