// ============================================================= // ENQUEUE SCRIPTS FOR MODAL // ============================================================= function storefront_enqueue_style() { wp_enqueue_style('modal_css', '//cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css', false); } add_action( 'wp_enqueue_scripts', 'storefront_enqueue_style' ); function storefront_enqueue_script() { wp_enqueue_script('modal_jquery', '//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js', false); wp_enqueue_script('modal_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js', false); } add_action( 'wp_enqueue_scripts', 'storefront_enqueue_script' );
HTML
<!--HTML EMBEDDED INTO THE DOCUMENT--> <div id="modal1" class="modal"> <h2>Hello World</h2> <a href="#" rel="modal:close">Close</a> </div> <!--LINK TO OPEN THE MODAL--> <p><a href="#modal1" rel="modal:open">Open Modal</a></p>
Leave a Reply