ナビゲーションをスキップする

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' );
            

返答する

トピックからそれないようにし、他のユーザーを尊重してください。この投稿に関係のない問題についてサポートが必要な場合は、サポート フォーラムを使用してチャットを開始するか、チケットを送信してください。

これらのタグを使用できます:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>