Site logo

Archived topic

Error messages above header area

10 replies · Started by avraham on May 30, 2016

Viewing posts 1–11 of 11

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,
Dina

Interesting, haven't run into this one before.

What version of WordPress are you using?

Wordpress 4.5.2

Hi 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,
Dina

Hi,

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.
Dina

Was 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.

Thank you for searching that out I will definitely ask them!!!!

Hi 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!!!

Doing 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.

This archived topic is closed to new replies.