Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div class="container">
- <?php get_template_part( 'partials/part', 'lookbook' ); ?>
- <section id="page-<?php echo $post->post_name; ?>" >
- <div class="row">
- <div class="col text-center">
- <h1 id="page-title" data-depth="1"><?php echo $post->post_title; ?></h1>
- </div>
- </div>
- <div class="row" data-depth="2">
- <div class="col text-center">
- <hr class="undertitle" />
- </div>
- </div>
- <div class="row salony-grid" data-depth="5">
- <div class="col-12">
- <div id="accordion" class="accordion">
- <?php
- $args_cat = [
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'hide_empty' => 0,
- ];
- $categories = get_categories($args_cat);
- if (!empty($categories)):
- foreach ($categories as $category):
- $args = [
- 'post_type' => 'store',
- 'posts_per_page' => -1,
- 'order' => 'ASC',
- 'orderby' => 'title',
- 'cat' => $category->term_id
- ];
- $query = new WP_Query($args);
- // Jesli kategoria nie jest pusta
- if( $query->have_posts() ) {
- echo '<div class="accordion-card">';
- echo '<div class="accordion-card--head collapsed" data-toggle="collapse" data-target="#collapse-'.$category->slug.'" aria-controls="collapse-'.$category->slug.'" aria-expanded="true">';
- echo '<h3>'.$category->name.'</h3>';
- echo '</div>';
- echo '<div id="collapse-'.$category->name.'" class="accordion-card--content collapse" aria-labelledby="collapse-'.$category->name.'" data-parent="#accordion">';
- echo '<div class="row">';
- }
- while ($query->have_posts()) : $query->the_post();
- echo '<div class="col-12 col-xs-12 col-md-4 col-lg-3 adresy">';
- // echo the_content();
- echo $post->post_content;
- echo'</div>';
- endwhile;
- if( $query->have_posts() ) {
- echo '</div>';
- echo '</div>';
- echo '</div>';
- }
- wp_reset_postdata();
- endforeach;
- endif;
- ?>
- </div>
- </div>
- </div>
- <div class="row newsletter">
- <?php get_template_part( 'partials/page-salony', 'newsletter' ); ?>
- </div>
- </section>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement