Ejemplo n.º 1
0
                echo $original_price;
                ?>
</span><?php 
            }
            ?>
                      <span class="black_price">¥<?php 
            echo $price;
            ?>
</span>
                    
                     </div>
                     <?php 
            if ($theme_shop_open) {
                ?>
  <div id="stars__<?php 
                echo shop_comment_stars();
                ?>
"class="srar case_satar"></div><?php 
            }
            ?>
                     <?php 
        } else {
            ?>
                       <p><?php 
            echo mb_strimwidth(strip_tags(apply_filters('the_excerp', get_the_excerpt($id))), 0, $textweidht, "...", 'utf-8');
            ?>
</p>
                     <?php 
        }
        ?>
            
Ejemplo n.º 2
0
    function widget($args, $instance)
    {
        // 输出显示在页面上
        extract($args);
        $id = $instance['id'];
        $before_content = $instance['before_content'];
        $after_content = $instance['after_content'];
        $left_right = apply_filters('widget_title', empty($instance['left_right']) ? __('') : $instance['left_right']);
        $first_mod = apply_filters('widget_title', empty($instance['first_mod']) ? __('') : $instance['first_mod']);
        $my_images = apply_filters('widget_title', empty($instance['my_images']) ? __('') : $instance['my_images']);
        $my_images_up = apply_filters('widget_title', empty($instance['my_images_up']) ? __('') : $instance['my_images_up']);
        $my_images_lr = apply_filters('widget_title', empty($instance['my_images_lr']) ? __('') : $instance['my_images_lr']);
        $my_text2 = apply_filters('widget_title', empty($instance['my_text2']) ? __('') : $instance['my_text2']);
        $my_text3 = apply_filters('widget_title', empty($instance['my_text3']) ? __('') : $instance['my_text3']);
        $my_text_up = apply_filters('widget_title', empty($instance['my_text_up']) ? __('') : $instance['my_text_up']);
        $my_b_images = apply_filters('widget_title', empty($instance['my_b_images']) ? __('') : $instance['my_b_images']);
        $my_b_images_ad = apply_filters('widget_title', empty($instance['my_b_images_ad']) ? __('') : $instance['my_b_images_ad']);
        $my_text_color = apply_filters('widget_title', empty($instance['my_text_color']) ? __('') : $instance['my_text_color']);
        $my_text_alpha = apply_filters('widget_title', empty($instance['my_text_alpha']) ? __('') : $instance['my_text_alpha']);
        $w_cat = apply_filters('widget_title', empty($instance['w_cat']) ? __('') : $instance['w_cat']);
        $my_images_buig = apply_filters('widget_title', empty($instance['my_images_buig']) ? __('') : $instance['my_images_buig']);
        $zhiding = apply_filters('widget_title', empty($instance['zhiding']) ? __('') : $instance['zhiding']);
        if ($my_text_color) {
            $my_text_colors = 'dack_text_mod';
        }
        if ($my_text_alpha) {
            $my_text_alphas = 'class="alpha' . $my_text_alpha . '"';
        }
        $nnmber = apply_filters('widget_title', empty($instance['nnmber']) ? __('8') : $instance['nnmber']);
        if ($zhiding == "1") {
            $post__in = get_option('sticky_posts');
        }
        if ($zhiding == "2") {
            $oder = "rand";
        } else {
            $oder = "ASC";
        }
        $args = array('cat' => $w_cat, 'showposts' => $nnmber, 'post__in' => $post__in, 'orderby' => $oder);
        $query = new WP_Query($args);
        $detect = new Mobile_Detect();
        $mytheme_detects = get_option('mytheme_detects');
        if ($my_images_buig == "1") {
            $text_nb = 120;
            $my_images_buigs = 'case_full';
            $my_images_d = "287x320.jpg";
        } else {
            if ($my_images_buig == "2") {
                $text_nb = 120;
                $my_images_buigs = 'fang';
                $my_images_d = "287.jpg";
            } else {
                $my_images_buigs = 'case';
                $my_images_d = "287x191.jpg";
                $text_nb = 40;
            }
        }
        $stickys = get_option('mytheme_stickys');
        ?>


<div class="caseshow">
     
        <a class="caseshow_title" href="<?php 
        echo get_category_link($w_cat);
        ?>
" target="_blank" >
        <?php 
        if ($my_text2) {
            ?>
 <h2> <?php 
            echo $my_text3;
            ?>
<strong><?php 
            echo $my_text2;
            ?>
</strong></h2><?php 
        }
        ?>
       
      
       </a>
       <div class="caseshow_in" id="designer_cont">

           <ul>
                
                     
                     <?php 
        $theme_shop_open = get_option('mytheme_theme_shop_open');
        while ($query->have_posts()) {
            $query->the_post();
            $tit = get_the_title();
            $id = get_the_ID();
            $content = get_the_content();
            $linkss = get_post_meta($id, "hoturl", true);
            if ($linkss != "") {
                $links1 = $linkss;
            } else {
                $links1 = get_permalink();
            }
            $price = get_post_meta($id, 'shop_price', true);
            $original_price = get_post_meta($id, "original_price", true);
            ?>
     
                     
                            
                              <li>
                    <a href="<?php 
            echo $links1;
            ?>
" target="_blank"  class="case_pic">   <?php 
            if (is_sticky() && !$stickys) {
                echo '<div id="tuijian_loop" class="tuijian_loop"></div>';
            }
            ?>
							<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail($my_images_buigs, array('alt' => $tit, 'title' => $tit));
            }
            ?>
                            </a>
                     <div class="case_div">
                     <strong><a href="<?php 
            the_permalink();
            ?>
" target="_blank" ><?php 
            echo mb_strimwidth(strip_tags(apply_filters('the_title', $tit)), 0, 35, "...", 'utf-8');
            ?>
</a></strong>
                    
                     
                    <?php 
            if ($price) {
                ?>
                     <div class="black_price_out">
                      
                       <?php 
                if ($original_price) {
                    ?>
<span class="black_price_yj">¥<?php 
                    echo $original_price;
                    ?>
</span><?php 
                }
                ?>
                      <b class="black_price">¥<?php 
                echo $price;
                ?>
</b>
                    
                     </div>
                     <?php 
                if ($theme_shop_open) {
                    ?>
  <div id="stars__<?php 
                    echo shop_comment_stars();
                    ?>
"class="srar case_satar"></div><?php 
                }
                ?>
                     <?php 
            } else {
                ?>
                      <?php 
                if (!$detect->isMobile()) {
                    ?>
 <p><?php 
                    echo mb_strimwidth(strip_tags(apply_filters('the_excerp', get_the_excerpt($id))), 0, 80, "...", 'utf-8');
                    ?>
</p><?php 
                }
                ?>
                     <?php 
            }
            ?>
                     </div>
                     
                     
                </li>
                            
                            
                            
                      <?php 
        }
        ?>
                     
                    </ul>
                    </div>
               </div> 
              
              
                 
        <?php 
    }