Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.69 KB | None | 0 0
  1. // Remplacer ça :  
  2.  
  3. <ul class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1 all-employed" >
  4.     <h1><?php echo $title_team ?></h1>
  5.     <?php wp_reset_postdata(); ?>
  6.             <?php wp_reset_postdata();
  7.         $args = array(
  8.             'post_type' => 'about',
  9.             'category__and' => array($cat_ID,61),
  10.             'posts_per_page' => 4,
  11.             'order' => ASC,
  12.         );
  13.         query_posts( $args );?>
  14.         <?php if (have_posts()) : ?>
  15.         <?php while (have_posts()) : the_post(); ?>
  16.             <?php
  17.                 $urlImage = get_post_thumbnail_id();
  18.                 $urlImage = wp_get_attachment_image_src($urlImage,'large');
  19.                 $urlImage = $urlImage[0];
  20.             ?>
  21.                 <li class="col-md-3 col-xs-12">
  22.                     <div class="thumbnail-article" style="background-image:url('<?php echo $urlImage; ?>')"></div>
  23.                     <h2 class="title" id="title-<?php the_ID() ?>"><?php the_title(); ?></h2>
  24.                     <div class="content" id="content-<?php the_ID() ?>"><?php the_content(); ?></div>
  25.                 </li>
  26.         <?php endwhile; ?>
  27.         <?php endif; ?>
  28.     </ul>
  29.     <div class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1" style="margin-bottom:100px" >
  30.         <?php wp_reset_postdata(); ?>
  31.             <?php wp_reset_postdata();
  32.         $args = array(
  33.             'post_type' => 'about',
  34.             'category__and' => array($cat_ID,61),
  35.             'posts_per_page' => 1,
  36.             'order' => ASC,
  37.             'offset' => 4,
  38.         );
  39.         query_posts( $args );?>
  40.         <?php if (have_posts()) : ?>
  41.         <?php while (have_posts()) : the_post(); ?>
  42.             <?php
  43.                 $urlImage = get_post_thumbnail_id();
  44.                 $urlImage = wp_get_attachment_image_src($urlImage,'large');
  45.                 $urlImage = $urlImage[0];
  46.             ?>
  47.         <?php endwhile; ?>
  48.         <?php endif; ?>
  49.     </div>
  50.     <ul class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1 all-employed" >
  51.     <?php wp_reset_postdata(); ?>
  52.             <?php wp_reset_postdata();
  53.         $args = array(
  54.             'post_type' => 'about',
  55.             'category__and' => array($cat_ID,61),
  56.             'posts_per_page' => 4,
  57.             'order' => DESC,
  58.         );
  59.         query_posts( $args );?>
  60.         <?php if (have_posts()) : ?>
  61.         <?php while (have_posts()) : the_post(); ?>
  62.             <?php
  63.                 $urlImage = get_post_thumbnail_id();
  64.                 $urlImage = wp_get_attachment_image_src($urlImage,'large');
  65.                 $urlImage = $urlImage[0];
  66.             ?>
  67.                 <li class="col-md-3 col-xs-12">
  68.                     <div class="thumbnail-article" style="background-image:url('<?php echo $urlImage; ?>')"></div>
  69.                     <h2 class="title" id="title-<?php the_ID() ?>"><?php the_title(); ?></h2>
  70.                     <div class="content" id="content-<?php the_ID() ?>"><?php the_content(); ?></div>
  71.                 </li>
  72.         <?php endwhile; ?>
  73.         <?php endif; ?>
  74.     </ul>
  75.  
  76. // Par ça :
  77.  
  78.     <ul class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1 all-employed" >
  79.     <h1><?php echo $title_team ?></h1>
  80.     <?php wp_reset_postdata(); ?>
  81.             <?php wp_reset_postdata();
  82.         $args = array(
  83.             'post_type' => 'about',
  84.             'category__and' => array($cat_ID,61),
  85.             'posts_per_page' => 20,
  86.             'order' => ASC,
  87.         );
  88.         query_posts( $args );?>
  89.         <?php $count = 0;  ?>
  90.         <?php if (have_posts()) : ?>
  91.         <?php while (have_posts()) : the_post(); ?>
  92.        
  93.             <?php
  94.                 $count += 1
  95.                 if ($count == 4 ) : {
  96.                     $count = 0; ?>
  97.                 </ul>
  98.                 <ul class="col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1 all-employed" >
  99.                 <?php } ?>
  100.            
  101.             <?php
  102.                 $urlImage = get_post_thumbnail_id();
  103.                 $urlImage = wp_get_attachment_image_src($urlImage,'large');
  104.                 $urlImage = $urlImage[0];
  105.             ?>
  106.                 <li class="col-md-3 col-xs-12">
  107.                     <div class="thumbnail-article" style="background-image:url('<?php echo $urlImage; ?>')"></div>
  108.                     <h2 class="title" id="title-<?php the_ID() ?>"><?php the_title(); ?></h2>
  109.                     <div class="content" id="content-<?php the_ID() ?>"><?php the_content(); ?></div>
  110.                 </li>
  111.         <?php endwhile; ?>
  112.         <?php endif; ?>
  113.     </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement