S
S
stepahryukin2020-04-30 20:35:53
Bootstrap
stepahryukin, 2020-04-30 20:35:53

How to implement modal window functionality in Wordpress loop?

Hello! Faced such problem: at me miniatures of records are deduced by a cycle. When you click on them, you need to display a thumbnail in full screen in the modal window. The bottom line is that I can’t integrate the modal window (bootstrap 4), and if it does, it displays a thumbnail of only one post, and not the one I clicked on. Please tell me how to do it right or where to dig. Preferably without plugins.

<div class="container">
  <div class="row work">
    <?php if( have_posts() ){ while( have_posts() ){ the_post(); ?>	
    <div class="col-3 mr-1 copywriter categoryPosts" <?php post_class(); ?> id="post-<?php the_ID(); ?>">
      <h2><a class="p-3" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
      <?php echo get_the_post_thumbnail( $id, 'full'); ?></div>
        <?php } /* конец while */ ?>
      <?php
      } // конец if
      else 
        echo "<h2>Записей нет.</h2>"; ?>
      </div>
    </div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question