sidebar.php
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php $get_lang = isset($wp_query->query_vars['prisna_translate_seo_request'])?urldecode($wp_query->query_vars['prisna_translate_seo_request']):''; ?>
<aside class="aside">
<section class="aside-wrap">
<?php if ( $post_type == 'news' | $taxonomy == 'news_catalog') : ?>
<section class="side-widget">
<div class="side-tit-bar">
<h4 class="side-tit">News</h4>
</div>
<ul class="side-cate">
<?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('menu' => 187, 'echo' => false)) ));?>
</ul>
</section>
<?php elseif (is_page()) : ?>
<section class="side-widget">
<div class="side-tit-bar">
<h4 class="side-tit">Information</h4>
</div>
<ul class="side-cate">
<?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('menu' => 70, 'echo' => false)) ));?>
</ul>
</section>
<?php else: ?>
<section class="side-widget">
<div class="side-tit-bar">
<h4 class="side-tit">Products Categories</h4>
</div>
<ul class="side-cate">
<?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('menu' => 4, 'echo' => false)) ));?>
</ul>
</section>
<div class="side-widget">
<div class="side-tit-bar">
<h2 class="side-tit">Recommended</h2>
</div>
<div class="side-product-items">
<div class="items_content">
<ul>
<?php $args = array('showposts' => 5, 'post_type' => 'post', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'special','value' => 'Feature Products','compare' => 'LIKE')));
$the_query = new WP_Query( $args ); if( $the_query->have_posts() ): while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li class="gm-sep side_product_item">
<figure> <a href="<?php the_permalink() ?>" class="item-img"><img src="<?php $images = get_field('product_gallery'); 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, 50,"..."); ?>"></a>
<figcaption>
<h3 class="item_title"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title',$post->post_title)), 0, 20,"..."); ?></a></h3>
<div class="item_text"><a href="<?php the_permalink() ?>"><?php echo mb_strimwidth(strip_tags(apply_filters('the_content',$post->post_content)), 0, 50,"..."); ?></div>
</figcaption>
</figure>
<a href="<?php the_permalink() ?>" class="add-friend"></a>
</li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
</div>
</div>
</div>
<?php endif; ?>
<?php $images = get_get_field('ad_sidebar_banner'); if( $images ): foreach( $images as $image ): ?>
<div class="side-bn"><a href="<?php echo $image['alt']; ?>"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['description']; ?>" /></a></div>
<?php endforeach; endif; ?>
</section>
</aside>