跳过导航

Open

Topic Tags: Compatibility

Overview of the issue

The text and links to available translations display more than once when using the following settings:

  • The Links to translation of posts option is enabled in WPMLLanguages.
  • You use the Avada theme builder feature with Global Layouts

Workaround

Our development team is aware of this problem and is working hard to fix the issue permanently.

As a temporary workaround, you can deactivate the Links to translation of posts option in the WPMLLanguages to hide the text and links altogether.

Alternatively, you can:

  1. Create a backup of your site or test this workaround on a staging site.
  2. Add the following code at the end of your active theme’s functions.php file and save the changes:
  3. add_filter('the_content', function ($content){
        if (is_single()) {
            if ($content == get_the_content()) {
                remove_filter('wpml_ls_post_alternative_languages', '__return_false');
            } else {
                add_filter('wpml_ls_post_alternative_languages', '__return_false');
            }
        } else {
            add_filter('wpml_ls_post_alternative_languages', '__return_false');
        }
          
        return $content;
    }, 1);
    
  4. Edit the page with the issue in the default language.
  5. Resave it.
  6. Update the translation.

留下回复

紧扣主题并尊重他人。如果您需要帮助解决与本帖无关的问题,请使用我们的 Support Forum 开始聊天或提交票据。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>