WordPress multisite mode calls the navigation menu of the specified site

888u

Last update at :2024-07-06,Edit by888u

After turning on WordPress multi-site mode, there may be multiple sites sharing a navigation menu. It would be too troublesome to create it separately for each site. After we create a navigation menu to be shared on a certain site, we can call this navigation menu through code in the header.php template of other site themes.

WordPress multi-site mode calls the navigation menu of a specified site sample code:



 'new_menu',
'container' => '',
'menu_class' => 'navbar-nav w-100 justify-content-between',
'menu_id' => '',
'items_wrap' => '
    %3$s
', ) ); ?>

In the above code: means switching to the site with ID 1, then calling the new_menu menu of site 1, and then passing Switch back to the current site.

Recommended site searches: webmaster IP, Hong Kong vps host, Ministry of Industry and Information Technology website registration query, proxy server IP website server rental, asp.net space, Hong Kong server, Hong Kong vps host rental, US proxy IP, 6 yuan a year cloud Server,

WordPress multisite mode calls the navigation menu of the specified site

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码