Does not open the modal window in (wordpress template)

0

I just added an own html file to Wordpress by adding this file in the templates folder of my theme. For this html file to work in Wordpress I had to go to PHP, everything works fine except one problem, the modal does not open when clicking on the link.

This is the code I use.

<?php
/*
* Template Name: Plantilla de pagina externa
* Description: Tema de Wordpress

*/


 ?>




<!DOCTYPE html>
<html>
   <head>
      <title>Mis Tiendas</title>


<!-- Estilos propios y Script propios -->

      <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/templates/style.css">
        <script src="<?php echo get_template_directory_uri(); ?>/templates/java.js"></script>
        
      
      <!-- Bootstrap -->    

      <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/templates/bootstrap.min.css"/>
      <script src="<?php echo get_template_directory_uri(); ?>/templates/jquery.min.js"></script>
      <script src="<?php echo get_template_directory_uri(); ?>/templates/bootstrap.min.js"></script>



   </head>
   
   
   
   <body>
   
    <a href="javascript:void(0);" data-href="content.html" class="openPopup"><li>Tienda UNO</li></a>
     <a href="javascript:void(0);" data-href="content2.html" class="openPopup"><li>Tienda DOS</li></a>
  
  
  
  
  
  
  <!-- Modal -->
 <div class="modal fade" id="myModal" role="dialog">
     <div class="modal-dialog">

         <!-- Modal content-->
         <div class="modal-content">
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal">&times;</button>
                 <h4 class="modal-title">Bootstrap Modal with Dynamic Content</h4>
             </div>
             <div class="modal-body">

             </div>
             <div class="modal-footer">
                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
             </div>
         </div>

     </div>
 </div>




 <script type="text/javascript">
 $(document).ready(function(){
     $('.openPopup').on('click',function(){
         var dataURL = $(this).attr('data-href');
         $('.modal-body').load(dataURL,function(){
             $('#myModal').modal({show:true});
         });
     });
 });


 </script>
  
  
  
  
  
  
  
    
   </body>
   </html>
   
   
   

I hope you can help me, it's the only problem I have to solve. Thank you very much for your attention.

    
asked by lvega 23.12.2018 в 06:01
source

0 answers