Topic: On every page error
Daniel pro asked 5 years ago
TypeError: jQuery(".button-collapse").sideNav is not a function. (In 'jQuery(".button-collapse").sideNav()', 'jQuery(".button-collapse").sideNav' is undefined) I get this on EVERY page BUT the Home page. I use WordPress, static Home Page. On Static Home (this has a URL of http://siote.com) it works just fine On every sub page the error is thrown It clearly shows that the initialization is done, but files cannot be found when on real URL's. This is super annoying.
Alan Mroczek free answered 5 years ago
Hi Daniel. I'm not sure without seeing your code and site what's going wrong. However I think that you should try adding for MDB bootstrap.min.js as a dependency. Then you have nice chain as follows: jQuery > Bootstrap > MDB It may not be the case, but as I mentioned previously, without code it's hard to tell, many things can be wrong, also double check jQuery version that you are using, if it is compatible with MDB version. Remeber, that you should try putting JS scripts in footer, because it affects site performance. For wordpress we also have whole Material Design for Wordpress theme, you can try if it meets your needs.
Daniel pro answered 5 years ago
forget it- for some reasons to me unknown, to work on other pages you must not enqueue in footer but in header wp_enqueue_script('MinimaXGoldMDB-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.7', false); //Enqueue MaterialDesign JS and add jQuery Dependency wp_enqueue_script('MinimaXGoldMDB-MaterialDesign-js', get_template_directory_uri() . '/js/mdb.min.js', array('jquery'), '3.4.1', false); WHO knows why.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Specification of the issue
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No