Current File : /customers/3/5/c/campinoeksjo.se/httpd.www/wp-content/themes/MHreklam/archive.php
<?php
 get_header();
?>
<?php
    $uri_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
      $uri_segments = explode('/', $uri_path);
   $url =  $uri_segments[2];
   $urlone =  $uri_segments[2];
   //print_r($urlone);
  // exit; 
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); 
$term_name =  $term->name; // will show the name
 
?>
<!-- <div class="breadcrumb-option" style="background-image:url(<?php echo home_url(); ?>/wp-content/uploads/2021/06/h9-parallax-img5.png);">
   <div class="container">
      <div class="bredcoms">
         <div class="breadcrumb__links">
            <a href="<?php echo home_url(); ?>">Home</a>
            <span><?php echo $term_name; ?></span>
         </div>
      </div>
   </div>
</div> -->
<section class="productpage">
   <div class="container">
      <div class="padding prosd">
         <div class="row">
            <div class="col-lg-3 col-sm-3">
               <div class="leftcategory">
                  <h3>CATEGORIES</h3>
                  <br>
                   
                  <?php wp_nav_menu( array( 'theme_location' => 'header_menu','menu' => 'Menu Category', 'menu_class' => '','container' => 'false' ) ); ?>
               </div>
            </div>
            <div class="col-lg-9 col-sm-9">
               <div class="rightsidecont">
                  <div class="row">
                      <?php
                        $args = array(
                          'post_type' => 'products','posts_per_page' => '9',
                          'tax_query' => array(
                              array(
                                  'taxonomy' => 'menu_category',
                                  'field' => 'slug',
                                  'terms' => $urlone
                              )
                          )
                        );
                        $my_query =  new WP_Query($args); 
                        $count=0;
                        while($my_query->have_posts()) :
                        $my_query->the_post();
                        $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->id), 'full');
                      ?>  
                        <div class="col-lg-4 col-sm-4">
                           <div class="proicom">
                              <div class="post_featured">
                                 <div class="post_thumb">
                                    <a href="<?php //the_permalink(); ?>" class="hover_icon hover_icon_link">
                                    <img src="<?php echo $thumb['0']; ?>">    
                                    </a>
                                 </div>
                                 <div class="procontent">
                                    <h3><a href="<?php //the_permalink(); ?>"><?php the_title(); ?></a></h3>
                                    <span class="price"><i class="fa fa-eur" aria-hidden="true"></i> <?php if(get_field('price')) { echo get_field('price');} else { echo ""; } ?></span>
                                 </div>
                              </div>
                           </div>
                        </div>
                     <?php 
                        $count++;
                        endwhile;
                        wp_reset_query(); 
                     ?>
                  </div>
                  <hr>
                  <?php if (function_exists("pagination")) {
                        pagination($my_query->max_num_pages);
                     } ?>
                   
               </div>
            </div>
         </div>
      </div>
   </div>
</section>
<?php get_footer(); ?>