archive-products.php 4.4 KB
<?php get_header();?>
<?php $get_lang = isset($wp_query->query_vars['prisna_translate_seo_request'])?urldecode($wp_query->query_vars['prisna_translate_seo_request']):''; ?>
<!-- page-wrapper start -->
        <div class="page-wrapper">
            <nav class="path-bar">
                <ul class="path-nav">
                    <li><?php if(function_exists('cmp_breadcrumbs')) cmp_breadcrumbs();?></li>
                </ul>
            </nav>

            <!-- page-layout start -->
            <section class="page-layout">
                <section class="layout">
                    <!-- aside begin -->
					<?php get_sidebar();?>
                    <!--// aisde end -->
                    <!-- main begin -->
                    <section class="main">
                        <div class="main-tit-bar">
                            <h1 class="title"><?php wp_title(); ?></h1>
							<div class="share-this"><div class="addthis_sharing_toolbox"></div> </div>
                        </div>
                        <!-- banner -->
                        <?php if(category_description(get_the_category()->cat_ID)): ?>
						<section class="main-banner">
							<section class="main-banner-cont">
								<div class="goods-summary">	  
									<?php if(z_taxonomy_image_url($cat->term_id)): ?> <img width="100%" src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" alt="<?php wp_title(); ?>"><?php endif; ?>
									<?php echo category_description(get_the_category()->cat_ID); ?>
								</div>
							</section>
						</section>
						<?php endif; ?>

                        <!-- list -->
                        <section class="product-list">
<ul class="product_list_items">
<?php $args = array(
        'cat'=>$cat_ID,
		'meta_key' => '_listorder',
		'orderby'   => 'meta_value_num', 
		'order' => DESC,
		'paged' => $paged
			);
$the_query = new WP_Query( $args ); if( $the_query->have_posts() ): while ( $the_query->have_posts() ) : $the_query->the_post(); 
$images = get_field('product_gallery');
if( $images ):  foreach( $images as $key=>$image ): 
			if(!is_array($images[$key])){
				$eric_id = $image;
				$eric_urcs = wp_get_attachment_image_src($eric_id);
				$eric_urc = $eric_urcs[0];
				$image = array(
					'id' => $eric_id, 
					'url' => $eric_urc, 
					'sizes' => array('thumbnail' => $eric_urc, )
					);
				$images[$key] = $image;
			}
			if (!$image['sizes']['thumbnail']) $image['sizes']['thumbnail'] = $srcs[0];
endforeach;  endif;?>
   <li class="product_list_item">
            <figure>
              <span class="item_img"><img src="<?php if( $images ): for($x=0;$x<1; $x++){ ?><?php echo $images[0]['sizes']['thumbnail']; ?><?php } endif; ?>" alt="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 200,"..."); ?>"><a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>"></a> </span>
              <figcaption>
			  <div class="item_information">
                     <h3 class="item_title"><a href="<?php the_permalink() ?>" title="<?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,""); ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 300,"..."); ?></a></h3>
                <div class="item_info"><?php $short = get_field('short_description');if( !empty($short) ): ?><?php the_field('short_description'); ?><?php else: ?><?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 500,"..."); ?><?php endif; ?></div>
                </div>
                <div class="product_btns">
                  <a href="javascript:" class="priduct_btn_inquiry add_email12">inquiry</a><a href="<?php the_permalink() ?>" class="priduct_btn_detail">detail</a>
                </div>
              </figcaption>
            </figure>
          </li>
<?php endwhile; endif;  wp_reset_query(); ?>
         </ul>                            
                            <section class="page-bar">
                                <div class="pages"><?php echo izt_pagenavi();?></div>
                            </section>

                        </section>
                    </section>
                    <!--// main end -->
                    <div class="clear"></div>
                </section>
            </section>
            <!--// page-layout end -->
        </div>
        <!--// page-wrapper end -->
		<?php get_footer();?>