Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- get_header();
- $simpleCats = array(26,24,20,19,4,9,10,23,27,8,22,21,25,18);
- $doorsCats = array(3,11,12,14,17,15,16,24,37,38,59,60,62);
- $rectangleCats = array(27,44,43,45,4,57,49,48,47);
- ?>
- <div class="twoColumn">
- <div class="inner">
- <div class="rightColumn">
- <?php
- $current = get_queried_object();
- if (!empty($current)) {
- $classes = get_tax_meta((int)$current->term_id, 'safety_class');
- if (!empty($classes)) {
- $classes = explode(',', $classes);
- if (is_array($classes)) {
- foreach($classes as $key => $val)
- $classes[$key] = trim($val);
- }
- }
- ?>
- <div class="listDescription">
- <h1>
- <?php echo $current->name; ?>
- <?php
- if (!empty($classes) and is_array($classes)) {
- ?>
- <small>(<?php
- $i = 0;
- $c = count($classes);
- foreach ($classes as $class) {
- $i++;
- echo '<span class="'.strtolower($class).'">'.$class.'</span>'.(($i !== $c) ? ', ' : null);
- }
- ?>)</small>
- <?php
- }
- unset($classes, $i);
- ?>
- </h1>
- <?php if ($current->description) { $desc = explode('{dropdown}', $current->description); ?>
- <div class="desc">
- <?php
- if(isset($desc[1]) and $desc[1]) {
- echo apply_filters('the_content', $desc[1]);
- } else {
- echo apply_filters('the_content', $desc[0]);
- }
- ?>
- </div>
- <?php } ?>
- </div>
- <?php } ?>
- <?php //if(!in_array($current->term_id, $simpleCats)) { ?>
- <div class="czechmadeBox">
- <p><?php _e('Objednáte-li si výrobek s tímto označením, dostanete výrobek s vysokou užitnou hodnotou a se zpracováním ve vysoké kvalitě. Zakoupením výrobku podpoříte rozvoj našeho hospodářství.', 'kavan'); ?></p>
- </div>
- <!-- <div class="labelDescription">
- <div class="label"><?php _e('Vysvětlivky ikon', 'kavan'); ?></div>
- <span class="label-rc2"><?php _e('Bezpečnostní třída 2', 'kavan'); ?></span>
- <span class="label-rc3"><?php _e('Bezpečnostní třída 3', 'kavan'); ?></span>
- <span class="label-rc4"><?php _e('Bezpečnostní třída 4', 'kavan'); ?></span>
- <span class="label-firered"><?php _e('Požární odolnost daná', 'kavan'); ?></span>
- <span class="label-fireblue"><?php _e('Požární odolnost volitelná', 'kavan'); ?></span>
- <span class="label-panika"><?php _e('Paniková funkce', 'kavan'); ?></span>
- <span class="label-elektro"><?php _e('Elektronické ovládání', 'kavan'); ?></span>
- </div> -->
- <?php //} ?>
- <?php
- $councils = get_tax_meta((int)$current->term_id, 'councils_cat');
- if (!empty($councils)) {
- $councils = get_posts(array('post_type' => 'post', 'category' => $councils, 'showposts' => -1));
- if (!empty($councils)) {
- ?>
- <div class="advicesBox">
- <h2 class="header">Poradník</h2>
- <ul>
- <?php
- foreach ($councils as $council) {
- if (!empty($council->post_content) and !empty($council->post_title)) {
- }
- ?>
- <li class="item">
- <h3 class="question"><?php echo $council->post_title; ?></h3>
- <div class="answer">
- <?php
- echo apply_filters('the_content', $council->post_content);
- ?>
- </div>
- </li>
- <?php
- }
- ?>
- </ul>
- </div>
- <?php
- }
- }
- unset($councils, $councils_more);
- ?>
- <div class="productList<?php if(in_array($current->term_id, $simpleCats)) { echo ' simple'; }?>">
- <?php if (have_posts()): ?>
- <?php
- while(have_posts()):the_post();
- $type = get_post_meta($post->ID, 'product_type', true);
- $icons = get_post_meta($post->ID, 'product_icons', true);
- $params_1 = get_post_meta($post->ID, 'product_params_1', true);
- $params_2 = get_post_meta($post->ID, 'product_params_2', true);
- $gallery = get_post_meta($post->ID, 'product_gallery', true);
- if(count($icons) > 3){
- if(count($icons) == 4) $padding = 'icons-4';
- if(count($icons) == 5) $padding = 'icons-5';
- if(count($icons) >= 6) $padding = 'icons-6';
- }
- ?>
- <div class="product<?php if(in_array($current->term_id, $doorsCats)) {echo ' door';} if(in_array($current->term_id, $rectangleCats)) {echo ' rectangle';} if (!empty($type)) { echo ' type';}?>">
- <h2 class="name <?php if(count($icons) > 3) echo $padding ?>"><a href="<?php the_permalink(); ?>"><?php echo preg_replace('/<span[^>]*class=\"hide\">(.*?)<\\/span>/si','',get_the_title()); ?></a></h2>
- <?php
- if (!empty($type)) {
- echo '<div class="id">'.$type.'</div>';
- }
- ?>
- <?php if (!empty($post->post_excerpt)) { ?>
- <p class="subname"><?php echo str_replace(array('[b]', '[/b]'), array('<span>', '</span>'), $post->post_excerpt); ?></p>
- <?php } ?>
- <?php if (!empty($params_1) and is_array($params_1)) { ?>
- <div class="desc">
- <?php
- foreach ($params_1 as $param) {
- if (Helper::isGood($param, 'title') and Helper::isGood($param, 'desc')) {
- ?>
- <p><?php echo $param['title']; ?>: <?php echo str_replace(array('[b]', '[/b]'), array('<strong>', '</strong>'), $param['desc']); ?></p>
- <?php
- }
- }
- ?>
- </div>
- <?php } ?>
- <?php
- if(in_array($current->term_id, $doorsCats)) {
- $i = 0;
- if (has_post_thumbnail()) { ?>
- <a href="<?php the_permalink(); ?>" class="image">
- <?php the_post_thumbnail('180x300_true'); ?>
- </a>
- <?php $i++; } ?>
- <?php
- if (!empty($gallery) and is_array($gallery)) {
- foreach ($gallery as $url) {
- $thumb_id = get_media_by_url($url);
- if ($thumb_id) {
- $i++;
- echo '<a href="'.get_the_permalink().'" class="image">
- '.wp_get_attachment_image($thumb_id, '180x300_true').'
- </a>';
- }
- if($i==3) break;
- }
- }
- ?>
- <?php }else if(in_array($current->term_id, $rectangleCats)){
- if (has_post_thumbnail()) { ?>
- <a href="<?php the_permalink(); ?>" class="image">
- <?php the_post_thumbnail('180x300_true'); ?>
- </a>
- <?php }
- } else{
- if (has_post_thumbnail()) { ?>
- <a href="<?php the_permalink(); ?>" class="image">
- <?php the_post_thumbnail('180x180_true'); ?>
- </a>
- <?php }
- } ?>
- <?php if (!empty($icons) and is_array($icons)) { ?>
- <div class="labels">
- <?php
- foreach ($icons as $icon) {
- echo '<span class="label-'.$icon.'"><i>'. $_GLOBALS['product_labels'][$icon] .'</i></span>';
- }
- ?>
- </div>
- <?php } ?>
- <?php if (!empty($params_2) and is_array($params_2)) { ?>
- <ul class="highlights">
- <?php foreach ($params_2 as $param) { ?>
- <li><?php echo $param; ?></li>
- <?php } ?>
- </ul>
- <?php } ?>
- <div class="clear"></div>
- <a href="<?php the_permalink(); ?>" class="button rounded"><?php _e('Podrobnosti'); ?></a>
- <a href="<?php the_permalink(); ?>#kontakt" class="button rounded inverted"><?php _e('Poptat'); ?></a>
- <div style="display:block;clear:both;"></div>
- </div>
- <?php endwhile; ?>
- <?php else: ?>
- <div class="flashMessage colorRed" style="margin-top:30px;"><?php _e('Je nám líto, ale v této kategorii nebyli žádné produkty nalezeny.'); ?></div>
- <?php endif; ?>
- </div>
- </div>
- <?php get_sidebar(); ?>
- </div>
- </div>
- <div class="contactForm">
- <div class="inner">
- <h2><?php _e('Kontaktní formulář', 'kavan'); ?></h2>
- <?php echo do_shortcode('[contact-form-7 id="44"]'); ?>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement