Bỏ qua điều hướng
7

We completed a round of testing between WordPress 4.1 and WPML. We’re very happy to report that WPML works with the new WordPress version. In our testing, we found two glitches with the new TwentyFifteen theme. This post explains these glitches and how to work around them.

First, the good news. WPML is fully compatible with WordPress 4.1. If you have existing sites, you can upgrade to WordPress 4.1 and you will not get new issues with WPML. As with any new WordPress version, you may run into issues with other plugins or the theme, so it’s a very good idea to test this upgrade on development sites first.

The issues that we’ve noticed are related to the new TwentyFifteen theme. If you are using it on new WordPress 4.1 sites or you are using a theme that’s derived from TwentyFifteen, make sure to apply the patches described in this post.

Footer Language Switcher Trimmed

The TwentyFifteen theme has a new footer and requires a tiny CSS patch to display WPML’s language switcher correctly.

Without this patch, the language footer switcher is partially hidden by the left sidebar.

Fortunately, there’s an easy fix, which you can apply directly from the WordPress admin. Go to WPML -> Languages -> Additional CSS (in Language switcher options section). The following CSS code will make the footer language switcher display correctly:

#lang_sel_footer {
    position: absolute;
    width:100%
}

This is how it will look in WPML’s admin screen:

Languages ‹ WPML — WordPress

Short Content Next to a Long Sidebar

Pages or posts that have very short content, next to very long sidebars may show another problem. When you scroll to the bottom of the page, you might be thrown back up to the top. To avoid the problem, you can disable WPML’s language switcher and add it manually using a theme-hook.

  1. Deactivate the language switcher footer from WPML -> Languages -> Footer language switcher style. Un-check the option to Show language switcher in footer.
    image02
  2. Edit your theme’s function.php and add the following code at the very end:
    add_action('twentyfifteen_credits', 'footer_language_switcher');
    function footer_language_switcher() {
    	echo do_shortcode('[wpml_language_selector_footer]');
    }

This patch will insert WPML’s footer language switcher to the credits section, where it will display nicely and correctly.

Have you tried WordPress 4.1 yet?