Waiting for author
Overview of the issue
When using the WP Residence theme, using a language switcher in the main top menu results in incorrect URLs. This issue is caused by the theme’s custom menu caching mechanism using transients, which caches the language switcher links.
Workaround
Please, make sure of having a full site backup of your site before proceeding.
- Add the following code in your functions.php file:
/** * Zap every WP Residence menu transient, on each page load. * The target string is unique enough that a single LIKE works. */ function cleanup_wpresidence_menu_transients() { global $wpdb; $like = '%' . $wpdb->esc_like( 'wpestate_wpresidence_primary_menu_complete' ) . '%'; $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $like ) ); } add_action( 'init', 'cleanup_wpresidence_menu_transients' );