这是一个老问题,如果像我这样的人在没有任何插件的情况下登录到WORDPRESS多站点菜单共享页面,
不仅菜单,您还可以使用相同的方法在所有网络站点上共享任何其他窗口小部件。
解决方案如下:编辑标题。php
//store the current blog_id - Use this function at the start of the function that you want to share
global $blog_id;
$current_blog_id = $blog_id;
//switch to the main blog which will have an id of 1
switch_to_blog(1);
//output the WordPress navigation menu - incase of menu-sharing use this
wp_nav_menu(
//add your arguments here
);
//switch back to the current blog being viewed - before ending of the function
switch_to_blog($current_blog_id);