0

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!

forwardtrends
  • 121
  • 1
  • 2
  • 8
  • Cannot reproduce the error. Is there any `Walker_Nav_Menu` in your theme `functions.php`? Sidenote: don't open/close PHP tags at each line, use it only to swap between HTML and PHP. – brasofilo Sep 18 '14 at 23:27
  • No Walker_Nav_Menu in my functions files and nothing crazy in there either. It's strange because the error only happens on one site, and it didn't happen at first. I noticed it during development while testing / switching through sites. – forwardtrends Sep 19 '14 at 13:22

0 Answers0