Advertisement
peanutheroo

students.php

Nov 23rd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: students
  4. */
  5.  
  6. get_header(); ?>
  7.  
  8.     <div class="container">
  9.         <div class="row row-offcanvas row-offcanvas-right">
  10.             <div class="col-xs-12 col-sm-9">
  11.                 <div class="row">
  12.                     <h2>Les étudiants</h2>
  13.                     <?php
  14.                     $args = array(
  15.                         'post_type' => 'students',
  16.                         'posts_per_page' => 100,
  17.                         'order' => 'ASC' // ou DESC
  18.                     );
  19.  
  20.                     $event_query = new WP_Query($args);
  21.  
  22.                     if($event_query->have_posts()) {
  23.                         while ($event_query->have_posts()) {
  24.                             $event_query->the_post(); ?>
  25.                             <div class="col-md-4">
  26.                                 <div class="bs-callout bs-callout-info">
  27.                                     <a class="students" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  28.                                 </div>
  29.                             </div>
  30.                         <?php
  31.                         }
  32.                     }
  33.                     ?>
  34.                 </div>
  35.             </div>
  36.         </div>
  37.     </div>
  38.  
  39. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement