- This topic has 10 replies, 2 voices, and was last updated 7 years, 10 months ago by Tom.
-
AuthorPosts
-
May 30, 2016 at 12:16 pm #198076avraham
Hi,
I get this message above my header area:
Warning: in_array() expects parameter 2 to be array, null given in /home1/avirog/public_html/wp-content/themes/generatepress/inc/navigation.php on line 207
It actually is there eight times.
What could be causing this, and how do I fix it? I know I messed up somewhere, but I’m not sure where to look for the solution.
Thanks for any guidance and advice!
All the best,
DinaMay 30, 2016 at 12:17 pm #198077avrahamMay 30, 2016 at 1:53 pm #198103TomLead DeveloperLead DeveloperInteresting, haven’t run into this one before.
What version of WordPress are you using?
May 30, 2016 at 1:56 pm #198104avrahamWordpress 4.5.2
May 30, 2016 at 2:03 pm #198106TomLead DeveloperLead DeveloperHmm, I wonder if you have a plugin manipulating the way menus are built.
Can you try #1 on this page?: https://generatepress.com/knowledgebase/debugging/
May 31, 2016 at 7:22 am #198234avrahamHi Tom,
Thank you, I deactivated the plugins and that was the culprit- a plugin called CoursePress Pro.
I will follow up with them, do you know of any specific incompatibility issues with GeneratePress?
Thanks very much,
DinaMay 31, 2016 at 7:46 am #198239avrahamHi,
I went over to the Coursepress Pro site, and they have a troublshooting flowchart I followed. One of the steps is to change themes to a default wordpress theme. Once I did that, the warning messages disappeared. So I think there is some sort of issue with Coursepress pro and generatepress not playing nicely with each other.
I asked them for guidance, and I just want to ask here as well- is there somewhere specific I should look to solve this?
Thanks so much, I appreciate it.
DinaMay 31, 2016 at 11:48 am #198301TomLead DeveloperLead DeveloperWas just doing some testing on the free version.
This is the function in GP it’s clashing with:
add_filter( 'walker_nav_menu_start_el', 'generate_nav_dropdown', 10, 4 ); function generate_nav_dropdown( $item_output, $item, $depth, $args ) { // If we're working with the primary or secondary theme locations if ( 'primary' == $args->theme_location || 'secondary' == $args->theme_location || 'slideout' == $args->theme_location ) { // If a dropdown menu is detected $dropdown = ( in_array( 'menu-item-has-children', $item->classes ) ) ? true : false; if ( $dropdown ) : // Add our arrow icon $item_output = str_replace( $args->link_after . '</a>', $args->link_after . '<span role="button" class="dropdown-menu-toggle" aria-expanded="false"></span></a>', $item_output ); endif; } // Return the output return $item_output; }
Basically, the error is saying
$item->classes
isn’t an array, which it is by default in WordPress.I wonder if something in the plugin is causing it not to be an array? Worth asking them.
May 31, 2016 at 12:05 pm #198320avrahamThank you for searching that out I will definitely ask them!!!!
May 31, 2016 at 12:21 pm #198326avrahamHi Tom,
I posted what you mentioned above. Meanwhile, I got this answer as a possible thing to check out:
///////
Are you using the debug flag enabled in your wp-config.php?
If yes, can you try disable it, changing:define( ‘WP_DEBUG’, true );
to
define( ‘WP_DEBUG’, false);
/////Do you think that can be the issue? I tried to find wp-config.php and I only found functions.php in the Appearance > Editor.
How can I check the wp_debug if it is true or false?
Thanks!!!
May 31, 2016 at 12:31 pm #198330TomLead DeveloperLead DeveloperDoing that will stop the errors from showing up, but it would still be nice to find a solution so they’re not happening in the first place 🙂
wp-config.php can be found in the same directory as the wp-admin, wp-content and wp-includes folder if you access your site using a file manager.
-
AuthorPosts
- You must be logged in to reply to this topic.