Error messages above header area

Home Forums Support Error messages above header area

Home Forums Support Error messages above header area

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #198076
    avraham

    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

    #198077
    avraham

    OH! Sorry, forgot to put the url:

    http://torahreviewcenter.org/

    Password is: welovekids!

    Thanks!

    #198103
    Tom
    Lead Developer
    Lead Developer

    Interesting, haven’t run into this one before.

    What version of WordPress are you using?

    #198104
    avraham

    Wordpress 4.5.2

    #198106
    Tom
    Lead Developer
    Lead Developer

    Hmm, 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/

    #198234
    avraham

    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

    #198239
    avraham

    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

    #198301
    Tom
    Lead Developer
    Lead Developer

    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.

    #198320
    avraham

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

    #198326
    avraham

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

    #198330
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.