• Can anyone offer any suggestions as to why the mobile toggle button it’s not working properly? I have converted this html website to wordpress. Everything works fine on the html website, but for some reason the toggle button doesnt seem to be working after I converted the standard menu to a wordpress menu. jquery seems to be working for other things, other than the toggle button. Must be something where i registerd the nav menu. I put everything in a page-home.php file.Link: https://testsite01.x10host.com/wp-admin/

    Admin user and pass:
    user: [Redacted]

    • This topic was modified 8 years, 4 months ago by Andrew Nevins.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @josh34, I would advise you change your username and password as soon as possible. In future please don’t post sensitive information on these forums. These are public facing forums and anyone could (and might already have) accessed your dashboard within the 8 hours that it was posted.

    • This reply was modified 8 years, 4 months ago by Andrew Nevins.
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It looks like this is the file that controls your navigation functionality: https://testsite01.x10host.com/wp-content/themes/naturebay/js/navigation.js?ver=20151215

    Within the first few lines it tells the browser to stop reading the file if a certain element does not exist:

    
    
    	container = document.getElementById( 'site-navigation' );
    	if ( ! container ) {
    		return;
    	}
    

    If you look at the source code of your page, you don’t have an element with the ID of ‘site-navigation’.

    I didn’t read the other lines of that file.

    Thread Starter josh34

    (@josh34)

    How do you suggest I fix it?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you tell us more about your setup, which theme are you using?

    Thread Starter josh34

    (@josh34)

    This is an HTML to wordpress conversion. I used the underscores theme. Everything works fine with the toggle nav menu on the static site. It just acted up after I hooked in the wordpress navigation function in the page-home.php. The menu seems to have been hooked in ok, it’s just the toggle part on mobile and tablet screens. Something must just be referenced wrong somewhere in the wp_nav_menu hook.

    Thread Starter josh34

    (@josh34)

    The javascript at the bottom of the page-home.php seems to be referenced ok. jquery was recognized. Unless it’s conflicting with something.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you have time to explore my initial conclusion that you don’t have the appropriate HTML for the JS to work? Your navigation JavaScript says it in black and white. If you don’t have the appropriate HTML then your JavaScript will not work.

    You have 2 options, change the JS or change the HTML.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I will be able to help you if you decide to change the JS, otherwise I’m not familiar with the underscores theme and we don’t support commercial themes so finding support might be more difficult.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Mobile toggle menu not working’ is closed to new replies.