Skip to content Skip to sidebar

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the WP Residence theme with WPML, the language switcher located in the Mobile/Tablet burger menu may redirect to unrelated URLs instead of the translated version of the current page.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …wp-content/plugins/wpresidence-core/api/inc/menu_functions/menu_functions.php file.
  • Look for line 156.
  • Replace:
    $mobile_menu = get_transient($transient_name);
            
  • With:
    $use_cache = ! has_filter( 'wpml_active_languages' );
    $mobile_menu = $use_cache ? get_transient( $transient_name ) : false;
            
  • Look for line 198.
  • Replace:
    set_transient($transient_name, $mobile_menu, 60 * 60 * 24);
            
  • With:
    if ( $use_cache ) {
      set_transient($transient_name, $mobile_menu, 60 * 60 * 24);
    }
            

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>