    <?php
    $down_info_arr=get_post_meta( get_the_ID(), 'down_info', true );
    ?>
    <?php
    if(get_term_meta(get_queried_object_id(),'cat_theme',1)==3){
        $sing_class='single-main ceo-width-auto';
    }else{
        $sing_class='single ceo-width-expand';
    }
    ?>
    <?php
        $img_w=_ceo('thumbnail-px')['width'];
        $img_h=_ceo('thumbnail-px')['height'];
        $style_w_h='';
    if(!empty($category = get_queried_object())){
        $category_id=$category->term_id;
        $thumbnail_custom = get_term_meta($category_id, 'thumbnail_px_custom', 'true');
        if(!empty($thumbnail_custom) && !empty($thumbnail_custom['height'])){
            $img_w = ! empty($thumbnail_custom['width']) ? $thumbnail_custom['width'] : '';
            $img_h = ! empty($thumbnail_custom['height']) ? $thumbnail_custom['height'] : '';
            $style_w_h = 'height:'.$img_h.'px';
        }
    }
    ?>

    <div class="ceo-category-web ceo-grid-medium" ceo-grid>
        <div class="<?php echo $sing_class; ?> ">
		<?php if(have_posts()) : while (have_posts()) : the_post();
            $down_info_arr=get_post_meta( get_the_ID(), 'down_info', true );

            ?>
		<div class="ajax-item ceo-width-1-1">
			<div class="blog-item side-item b-a ceo-background-default ceo-overflow-hidden ceo-padding-small b-r-4">
				<div class="ceo-grid-collapse" ceo-grid>
				    <div class="ceo-width-1-1@s ceo-width-auto@m ceo-width-auto@l ceo-width-auto@xl ceo-vip-icons">
				        <?php if(_ceo('ceo_cat_viptb') == true ): ?>
    				        <?php if(get_post_meta(get_the_ID(),'member_down',1)!=1){?>
                            <span class="meta-vip-tag"></span>
                            <?php }?>
                        <?php endif; ?>
						<a href="<?php the_permalink(); ?>" <?php echo _target_blank();?> class="cover b-r-4 ceo-display-block ceo-overflow-hidden">
							<img src="<?php echo post_thumbnail_src($img_w,$img_h); ?>" alt="<?php the_title(); ?>" />
						</a>
					</div>
					<div class="ceo-width-1-1@s ceo-width-expand">
						<div class="blog-item-content">
						    <div class="ceo-web ceo-blog-items">
    							<h3 class="ceo-text-truncate"><a href="<?php the_permalink(); ?>" <?php echo _target_blank();?> class="title ceo-h4">
    							    <?php if(_ceo('ceo_cat_tese') == true ): ?>
            	    			    <?php
                                    $tese_arr = get_post_meta( get_the_ID(), 'ceo_post_tese', true );
                                    if(!empty($tese_arr['ceo-tese-tag'])){
                                        $ymetaValue = $tese_arr['ceo-tese-tag'];
                                    }else{
                                        $ymetaValue='';
                                    }

                                    if (($ymetaValue=="remen")) {
                                        echo '<div class="ceo-tese-remen"><span class="i">#</span>热门</div>';
                                    }

                                    elseif (($ymetaValue=="dujia")) {
                                        echo '<div class="ceo-tese-dujia"><span class="i">#</span>独家</div>';
                                    }

                                    elseif (($ymetaValue=="zuixin")) {
                                        echo '<div class="ceo-tese-zuixin"><span class="i">#</span>最新</div>';
                                    }

                                    elseif (($ymetaValue=="tuijian")) {
                                        echo '<div class="ceo-tese-tuijian"><span class="i">#</span>推荐</div>';
                                    }

                                    elseif (($ymetaValue=="jingpin")) {
                                        echo '<div class="ceo-tese-jingpin"><span class="i">#</span>精品</div>';
                                    }

                                		elseif (($ymetaValue=="buxuanze")) {
                                   	 echo '';
                                   	 }

                                    ?>
                                    <?php endif; ?>
            					    <?php if (is_sticky()): ?><i class="ceo-tops iconfont icon-brand-fill" style="font-size: 22px;"></i><?php endif; ?>
            					    <?php get_template_part( 'template-parts/tese/custom', 'tese' ); ?>
            					    <?php the_title(); ?>
                				</a></h3>
                				<div class="ceo-web-list ceo-flex">
                    				<p><i class="iconfont icon-rili"></i> <?php the_time('Y-m-d') ?></p>
                    				<p class="ceo-flex-1"><i class="iconfont icon-yanjing"></i> <?php post_views('', ''); ?> 人关注</p>
					                <span>
					                    <label>￥</label>
					                    <?php
                                        if (get_post_meta(get_the_ID(), 'erphp_down', 1) && get_post_meta(get_the_ID(), 'erphp_down', 1) != 4) {
                                            echo ' ' .get_post_meta(get_the_ID(),'down_price',1).'';
                                        } ?>元
                                    </span>
                				</div>
							</div>
							<div class="ceo-web-info">
							    <ul>
							        <?php if(!empty($down_info_arr)){?>
                                        <?php
                                        if(!empty($down_info_arr)){
                                            foreach ($down_info_arr as $k=>$v){
                                                $number=$k+1;
                                                echo '<li><p class="ceo-web-info-pt">'.$v['title'].'</p>'.'<p class="ceo-web-info-pf">'.$v['desc'].'</b></p>';
                                            }
                                        }
                                        ?>
                                    <?php } ?>
					            </ul>
					            <div class="ceo-web-contact">
					                <a class="ceo-web-ys" href="<?php echo get_post_meta( get_the_ID(), 'down_demourl', true );?>" rel="noreferrer nofollow" target="_blank">网站预览</a>
					                <a class="ceo-web-gm" href="<?php the_permalink(); ?>" <?php echo _target_blank();?>>立即购买</a>
					            </div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php endwhile; else: ?>

		<div class="ceo-width-auto">
			<div class="ceo-alert-primary ceo-width-1-2 ceo-container" ceo-alert>
				<a class="ceo-alert-close" ceo-close></a>
				<p class="ceo-padding-small ceo-text-center">暂无内容！</p>
			</div>
		</div>

		<?php endif; ?>
		<div class="fenye ceo-text-center ceo-text-small ceo-margin-large-top ceo-margin-large-bottom">
			<?php fenye(); ?>
		</div>
	</div>
    <?php
    if(get_term_meta(get_queried_object_id(),'cat_theme',1)==3){
//        $div_sidebar_class='ceo-width-auto sidebar-column';
        $div_sidebar_class='sidebar-column';
    }else{
        $div_sidebar_class='ceo-width-auto';
    }
    ?>
</div>

<script>
    //跟随
    $(function () {
        jQuery(".sidebar-column").theiaStickySidebar({
            additionalMarginTop: 0
        })
    });
</script>

