Guest User

Untitled

a guest
Dec 4th, 2022
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.59 KB | None | 0 0
  1. <section class="container-xxxl mb-4">
  2.  
  3.   <!-- Filters -->
  4.   <?php $categories = get_categories(); ?>
  5.  
  6.     <ul class="nav text-center project-sections">
  7.       <li class="nav-item">
  8.         <a class="nav-link cat-list_item active" href="#" data-slug="">
  9.           <i class="fa-solid fa-folder fa-2x"></i>
  10.           <p><?php pll_e('Все проекты'); ?></p>
  11.         </a>
  12.       </li>
  13.    
  14.     <?php
  15.    foreach( $categories as $category ) { ?>
  16.       <li class="nav-item">
  17.         <a class="nav-link cat-list_item" href="#" data-slug="<?php echo ($category -> slug); ?>">
  18.           <i class="fa-solid fa-folder fa-2x"></i>
  19.           <p><?php echo ($category -> name); ?></p>
  20.         </a>
  21.       </li>
  22.     <?php } ?>
  23.     </ul>
  24.   <!-- Filters -->
  25.  
  26.   <!-- Project cards -->
  27.   <div class="container-xxxl">
  28.     <div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 g-3 post-filter">
  29.      
  30.     <?php
  31.      $projects = new WP_Query([
  32.        'posts_per_page'    => 1,
  33.         'post_type'         => 'post',
  34.         'orderby'           => 'data',
  35.         'order'             => 'DESC',
  36.         'paged'             => 1,
  37.       ]);
  38.     ?>
  39.  
  40.     <?php if ($projects->have_posts()) {
  41.       while ($projects->have_posts()) {
  42.         $projects->the_post();
  43.         get_template_part('construction_parts/project-card');
  44.       }
  45.     wp_reset_postdata(); // reset
  46.     }
  47.     ?>
  48.     </div>
  49.   </div>
  50.   <!-- Project cards -->
  51.   <div class="btn__wrapper">
  52.     <a href="#!" class="btn btn__primary" data-slug="<?php echo ($category -> slug); ?>" id="load-more">Load more</a>
  53.   </div>
  54. </section>
Advertisement
Add Comment
Please, Sign In to add comment