In WordPress Multisite I made a global site nav for linking to the main site, using a simple:
<?php switch_to_blog(1); ?>
<?php wp_list_pages('title_li=&depth=1&sort_column=menu_order'); ?>
<?php restore_current_blog(); ?>
I have 10 websites on the network, but only one of the child sites is kicking out an error that I haven't been able to resolve:
Warning: in_array() expects parameter 2 to be array, null given in /wp-includes/post-template.php on line 1299
The links are output to the screen ok, but along side an error for each one.
After some research I think it's related to this existing issue, which hasn't been addressed for the last few WordPress updates and no fixes are posted:
https://core.trac.wordpress.org/ticket/23290
Wondering if anyone has any input on this, or maybe a function to do this without errors? I've tried writing a function in functions.php to set a global variable menu but it still uses wp_list_pages, its hacky and still not working properly.
Any input would be huge, Thank you!