Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress From Bootstrap to WordPress Add Bootstrap Components to WordPress Theme How to Add Bootstrap Modal Windows to Your WordPress Theme

Is there a way to embed the modal box not in the footer? maybe in functions.php? what the best practice?

How to add the modal box the wright way? so that I will be able to use it everywhere on the website, and with all kinds of content inside?

1 Answer

Hi,

May be you could try using the

<?php get_template_part('modal', 'contact'); ?>

and have a file named " modal-contact.php "

and then if you have other modals you would like to use just make other template files and the get template part function with corresponding file name :)

Craig