Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDiego Palma
12,653 PointsAs soon as I click on the contact button, the MODAL fades in and then immediately disappears.
Browsing online I found that this is typical behavior for loading the Modal plugin JavaScript twice.
So this is what I did: I went to the functions.php and in the add_action function I replaced the handle theme_js for bootstrap_js (see code below). This fixed the problem but now I'm confused... Any ideas?
wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true );
wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery', 'bootstrap_js'), '', true );
} add_action( 'wp_enqueue_scripts', 'bootstrap_js' );
8 Answers
Viktor Andonov
Courses Plus Student 1,341 PointsSettings>BS Shortcodes uncheck the boxes Load Twitter Bootstrap css file and Load Twitter Bootstrap javascript. BS Shortcodes plugin loads the bootstrap css & js on it own and it the tut you are loading it too.
David McGaa
2,759 PointsJust to add Stack Overflow. Appears to be caused by loading the Bootstrap framework multiple times (once in the functions.php and once in the Bootstrap shortcodes plugin), adding two listeners to the same button.
Need to use one or the other, not both.
Cristi Roberts
5,905 PointsI did what Viktor and David said, and now it works fine for me! Thanks so much guys!
Diego Palma
12,653 PointsThank you Viktor, that worked for me/
Nuno Sarmento
4,400 PointsThank you Vitor :)
Danka Kareen Shank
6,978 PointsThank you Viktor, it's work for me
Amarria WordPress Design
9,750 PointsThis worked for me:
<?php if( function_exists( 'ninja_forms_display_form' ) ){ Ninja_Forms()->display( 1 ); } ?>
Don Macarthur
28,430 PointsJust had this issue as well. Thanks for the heads up! :-)
Doris Keller
Front End Web Development Techdegree Graduate 47,927 PointsI had the same problem and I tried with the unchecked css and js-files, but as a result it didn't took consideration of the right css anymore - then I unchecked only the bootstrap-js-file and now it works. Thank you very much!
David Richied
18,057 PointsDavid Richied
18,057 PointsThanks to the helpful comment of Josh Miclette (https://teamtreehouse.com/community/carousel-slider-works-but-the-images-do-not-slide), I was able to find a solution.
Go to Settings>BS Shortcodes and uncheck the boxes that say Load Twitter Bootstrap css file and Load Twitter Bootstrap javascript file
Now, you'll also have to go back and change your theme_js function back to normal (I would just download the project folder and replace everything from your functions.php file with the contents of the functions.php file in the project downloads folder). Hope this works!