Advertisement
miriamdepaula

WordPress: Bootstrap grid

Jan 16th, 2021
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2.                
  3.                 $columns_num = 2;
  4.                 echo '<div class="row">';                                      
  5.  
  6.                 while (have_posts()) : the_post();
  7.                     echo '<div class="col-sm-12 col-md-6 col-lg-' . 12 / $columns_num . ' posts">';
  8.                     echo '  <div class="thumb-wrapper">';
  9.                     echo '    <div class="data">'.get_the_time('d/m/Y').'</div>';
  10.                     echo '    <a href="'.get_permalink().'">' . get_the_post_thumbnail( get_the_ID(), 'slides-size', array( 'class' => 'post-thumb', 'title' => get_the_title(get_the_ID()) ) ) . '</a>';
  11.                     echo '  </div>';
  12.                     echo '  <div class="excerpt-wrapper">';
  13.                     echo '    <h2><a href="'.get_permalink().'">' . get_the_title() . '</a></h2>';
  14.                     echo      get_the_excerpt();
  15.                     echo '  </div>';
  16.                     echo '</div>';
  17.            
  18.                 endwhile;
  19.  
  20.                 echo '</div>';
  21.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement