Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.97 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.       <div class="container">
  4.         <?php get_template_part( 'partials/part', 'lookbook' ); ?>
  5.         <section id="page-<?php echo  $post->post_name; ?>" >
  6.           <div class="row">
  7.             <div class="col text-center">
  8.               <h1 id="page-title" data-depth="1"><?php echo  $post->post_title; ?></h1>
  9.             </div>
  10.           </div>
  11.           <div class="row" data-depth="2">
  12.             <div class="col text-center">
  13.               <hr class="undertitle" />
  14.             </div>
  15.           </div>
  16.           <div class="row salony-grid" data-depth="5">
  17.             <div class="col-12">
  18.               <div id="accordion" class="accordion">
  19.  
  20.  
  21.  
  22.                 <?php
  23.                 $args_cat = [
  24.                   'orderby' => 'name',
  25.                   'order' => 'ASC',
  26.                   'hide_empty' => 0,
  27.                 ];
  28.                 $categories = get_categories($args_cat);
  29.  
  30.  
  31.  
  32.                 if (!empty($categories)):
  33.                   foreach ($categories as $category):
  34.                     $args = [
  35.                       'post_type' => 'store',
  36.                       'posts_per_page' => -1,
  37.                       'order' => 'ASC',
  38.                       'orderby' => 'title',
  39.                       'cat' => $category->term_id
  40.                     ];
  41.                     $query = new WP_Query($args);
  42.  
  43.                    
  44.                     // Jesli kategoria nie jest pusta
  45.                     if( $query->have_posts() ) {
  46.                       echo '<div class="accordion-card">';
  47.                       echo '<div class="accordion-card--head collapsed" data-toggle="collapse" data-target="#collapse-'.$category->slug.'" aria-controls="collapse-'.$category->slug.'" aria-expanded="true">';
  48.                       echo '<h3>'.$category->name.'</h3>';
  49.                       echo '</div>';
  50.                       echo '<div id="collapse-'.$category->name.'" class="accordion-card--content collapse" aria-labelledby="collapse-'.$category->name.'" data-parent="#accordion">';
  51.                       echo '<div class="row">';
  52.                     }
  53.  
  54.                     while ($query->have_posts()) : $query->the_post();
  55.                       echo '<div class="col-12 col-xs-12 col-md-4 col-lg-3 adresy">';
  56.                       // echo the_content();
  57.                       echo $post->post_content;
  58.                       echo'</div>';
  59.                     endwhile;
  60.  
  61.                     if( $query->have_posts() ) {
  62.                       echo '</div>';
  63.                       echo '</div>';
  64.                       echo '</div>';
  65.                     }
  66.  
  67.                     wp_reset_postdata();
  68.                   endforeach;
  69.                 endif;
  70.                 ?>
  71.  
  72.  
  73.               </div>
  74.             </div>
  75.           </div>
  76.           <div class="row newsletter">
  77.             <?php get_template_part( 'partials/page-salony', 'newsletter' ); ?>
  78.           </div>
  79.  
  80.         </section>
  81.       </div>
  82.  
  83. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement