• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sf_aq_resize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中sf_aq_resize函数的典型用法代码示例。如果您正苦于以下问题:PHP sf_aq_resize函数的具体用法?PHP sf_aq_resize怎么用?PHP sf_aq_resize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sf_aq_resize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: content

 public function content($atts, $content = null)
 {
     $title = $el_class = $text_color = $image_url = $image_object = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'character' => '', 'image' => '', 'animation' => '', 'animation_delay' => '', 'box_type' => '', 'color' => '', 'link' => '', 'target' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
     $output = '';
     if ($image != "") {
         $img_url = wp_get_attachment_url($image, 'full');
         $image_oject = array();
         if (function_exists('sf_aq_resize')) {
             $image_object = sf_aq_resize($img_url, 70, 70, true, false);
         }
         $image_url = $image_object[0];
     }
     $icon_box_output = do_shortcode('[sf_iconbox character="' . $character . '" image="' . $image . '" color="standard" type="' . $box_type . '" title="' . $title . '" animation="' . $animation . '" animation_delay="' . $animation_delay . '" color="' . $color . '" link="' . $link . '" target="' . $target . '"]' . $content . '[/sf_iconbox]');
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="spb_icon_box ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper box-wrap">';
     $output .= "\n\t\t\t" . $icon_box_output;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel;
     $sf_include_carousel = true;
     return $output;
 }
开发者ID:VeritasStrategies,项目名称:Poplin,代码行数:26,代码来源:icon-boxes.php


示例2: foreach

if (version_compare(WOOCOMMERCE_VERSION, "2.0.0") >= 0) {
    $attachment_ids = $product->get_gallery_attachment_ids();
    if ($attachment_ids) {
        foreach ($attachment_ids as $attachment_id) {
            $classes = array('zoom');
            if ($loop == 0 || $loop % $columns == 0) {
                $classes[] = 'first';
            }
            if (($loop + 1) % $columns == 0) {
                $classes[] = 'last';
            }
            $image_link = wp_get_attachment_url($attachment_id);
            if (!$image_link) {
                continue;
            }
            $image = sf_aq_resize($image_link, 562, NULL, true, false);
            $image_class = esc_attr(implode(' ', $classes));
            $image_title = esc_attr(get_the_title($attachment_id));
            $image_alt = esc_attr(sf_get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true));
            if ($image) {
                $image_html = '<img class="product-slider-image" data-zoom-image="' . $image_link . '" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" title="' . $image_title . '" />';
                echo apply_filters('woocommerce_single_product_image_thumbnail_html', sprintf('<li>%s<a href="%s" class="%s" title="%s" alt="%s" data-rel="prettyPhoto[product-gallery]"><i class="ss-expand"></i></a></li>', $image_html, $image_link, $image_class, $image_title, $image_alt), $attachment_id, $post->ID, $image_class);
            }
            $loop++;
        }
    }
} else {
    $attachment_ids = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID, 'post__not_in' => array(get_post_thumbnail_id()), 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'));
    if ($attachment_ids) {
        $loop = 0;
        $columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:31,代码来源:product-image.php


示例3: content

 public function content($atts, $content = null)
 {
     $title = $order = $text_size = $items = $el_class = $width = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'text_size' => '', 'item_count' => '', 'order' => '', 'category' => 'all', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1'), $atts));
     $output = '';
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // TESTIMONIAL QUERY SETUP
     global $post, $wp_query;
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
     $testimonials = new WP_Query($testimonials_args);
     if ($autoplay == "yes") {
         $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides">';
     } else {
         $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides">';
     }
     // TESTIMONIAL LOOP
     while ($testimonials->have_posts()) {
         $testimonials->the_post();
         $testimonial_text = get_the_content();
         $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true);
         $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true);
         $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID);
         foreach ($testimonial_image as $detail_image) {
             $testimonial_image_url = $detail_image['url'];
             break;
         }
         if (!$testimonial_image) {
             $testimonial_image = get_post_thumbnail_id();
             $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full');
         }
         $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false);
         $items .= '<li class="testimonial">';
         $items .= '<div class="testimonial-text text-' . $text_size . '">' . do_shortcode($testimonial_text) . '</div>';
         if ($testimonial_image) {
             $items .= '<div class="testimonial-cite has-image">';
             $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />';
             if ($testimonial_cite_subtext != "") {
                 $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>';
             } else {
                 $items .= '<cite>' . $testimonial_cite . '</cite>';
             }
         } else {
             $items .= '<div class="testimonial-cite">';
             if ($testimonial_cite_subtext != "") {
                 $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>';
             } else {
                 $items .= '<cite>' . $testimonial_cite . '</cite>';
             }
         }
         $items .= '</div>';
         $items .= '</li>';
     }
     wp_reset_postdata();
     $items .= '</ul></div>';
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     $sidebars = '';
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $sidebars = 'one-sidebar';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $sidebars = 'both-sidebars';
         } else {
             $sidebars = 'no-sidebars';
         }
     }
     $el_class .= ' testimonial';
     // Full width setup
     $fullwidth = false;
     if ($alt_background != "none") {
         $fullwidth = true;
     }
     $output .= "\n\t" . '<div class="spb_testimonial_slider_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper slider-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>' : '';
     $output .= "\n\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position, $width, $fullwidth, false, $alt_background) . $output . $this->endRow($el_position, $width, $fullwidth, false);
     global $sf_include_carousel;
     $sf_include_carousel = true;
     return $output;
 }
开发者ID:VeritasStrategies,项目名称:Poplin,代码行数:92,代码来源:testimonial-slider.php


示例4: sf_mini_product_items

 function sf_mini_product_items($asset_type, $category, $item_count, $sidebar_config, $width)
 {
     global $woocommerce, $sf_catalog_mode;
     $product_list_output = $image = "";
     $args = array();
     // ARRAY ARGUMENTS
     if ($asset_type == "latest-products") {
         $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count);
         $args['meta_query'] = array();
         $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
         $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
     } else {
         if ($asset_type == "featured-products") {
             $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'meta_key' => '_featured', 'meta_value' => 'yes', 'posts_per_page' => $item_count);
         } else {
             if ($asset_type == "top-rated") {
                 add_filter('posts_clauses', array($woocommerce->query, 'order_by_rating_post_clauses'));
                 $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count);
                 $args['meta_query'] = $woocommerce->query->get_meta_query();
             } else {
                 if ($asset_type == "recently-viewed") {
                     // Get recently viewed product cookies data
                     $viewed_products = !empty($_COOKIE['woocommerce_recently_viewed']) ? (array) explode('|', $_COOKIE['woocommerce_recently_viewed']) : array();
                     $viewed_products = array_filter(array_map('absint', $viewed_products));
                     // If no data, quit
                     if (empty($viewed_products)) {
                         return '<p class="no-products">' . __("You haven't viewed any products yet.", "swiftframework") . '</p>';
                     }
                     // Create query arguments array
                     $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post__in' => $viewed_products, 'orderby' => 'rand');
                     // Add meta_query to query args
                     //$args['meta_query'] = array();
                     // Check products stock status
                     //$args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
                 } else {
                     if ($asset_type == "sale-products") {
                         // Get products on sale
                         $product_ids_on_sale = wc_get_product_ids_on_sale();
                         $meta_query = array();
                         $meta_query[] = WC()->query->visibility_meta_query();
                         $meta_query[] = WC()->query->stock_status_meta_query();
                         $meta_query = array_filter($meta_query);
                         $args = array('product_cat' => $category, 'posts_per_page' => $item_count, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'meta_query' => $meta_query, 'post__in' => array_merge(array(0), $product_ids_on_sale));
                     } else {
                         $args = array('post_type' => 'product', 'post_status' => 'publish', 'product_cat' => $category, 'ignore_sticky_posts' => 1, 'posts_per_page' => $item_count, 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')));
                         $args['meta_query'] = array();
                         $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
                         $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
                     }
                 }
             }
         }
     }
     // OUTPUT PRODUCTS
     $products = new WP_Query($args);
     if ($products->have_posts()) {
         $product_list_output .= '<ul class="mini-list mini-' . $asset_type . '">';
         while ($products->have_posts()) {
             $products->the_post();
             $product_output = $rating_output = "";
             global $product, $post, $wpdb, $woocommerce_loop;
             // Ensure visibility
             if (!$product->is_visible()) {
                 return;
             }
             if (has_post_thumbnail()) {
                 $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
                 $image_alt = esc_attr(sf_get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true));
                 $image_link = wp_get_attachment_url(get_post_thumbnail_id());
                 if ($image_link == "") {
                     $image_link = "default";
                 }
                 $image = sf_aq_resize($image_link, 70, 70, true, false);
                 if ($image) {
                     $image_html = '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" title="' . $image_title . '" alt="' . $image_alt . '" />';
                 }
             }
             if (comments_open()) {
                 $count = $wpdb->get_var("\n\t\t           \t\t    SELECT COUNT(meta_value) FROM {$wpdb->commentmeta}\n\t\t           \t\t    LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t           \t\t    WHERE meta_key = 'rating'\n\t\t           \t\t    AND comment_post_ID = {$post->ID}\n\t\t           \t\t    AND comment_approved = '1'\n\t\t           \t\t    AND meta_value > 0\n\t\t           \t\t");
                 $rating = $wpdb->get_var("\n\t\t           \t        SELECT SUM(meta_value) FROM {$wpdb->commentmeta}\n\t\t           \t        LEFT JOIN {$wpdb->comments} ON {$wpdb->commentmeta}.comment_id = {$wpdb->comments}.comment_ID\n\t\t           \t        WHERE meta_key = 'rating'\n\t\t           \t        AND comment_post_ID = {$post->ID}\n\t\t           \t        AND comment_approved = '1'\n\t\t           \t    ");
                 if ($count > 0) {
                     $average = number_format($rating / $count, 2);
                     $rating_output = '<div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'swiftframework'), $average) . '" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span style="width:' . $average * 16 . 'px"><span itemprop="ratingValue" class="rating">' . $average . '</span> ' . __('out of 5', 'swiftframework') . '</span></div>';
                 }
             }
             $product_output .= '<li class="clearfix" itemscope itemtype="http://schema.org/Product">';
             if ($image) {
                 $product_output .= '<figure>';
                 $product_output .= '<a href="' . get_permalink($post->ID) . '">';
                 $product_output .= $image_html;
                 $product_output .= '</a>';
                 $product_output .= '</figure>';
             }
             $product_output .= '<div class="product-details">';
             $product_output .= '<h5 itemprop="name"><a href="' . get_permalink($post->ID) . '">' . get_the_title() . '</a></h5>';
             if ($asset_type == "top-rated") {
                 $product_output .= $rating_output;
             } else {
                 $size = sizeof(get_the_terms($post->ID, 'product_cat'));
                 $product_output .= $product->get_categories(', ', '<span class="product-cats">', '</span>');
//.........这里部分代码省略.........
开发者ID:arobbins,项目名称:spellestate,代码行数:101,代码来源:sf-products.php


示例5: widget

    function widget($args, $instance)
    {
        global $post;
        extract($args);
        // Widget Options
        $title = apply_filters('widget_title', $instance['title']);
        // Title
        $number = $instance['number'];
        // Number of posts to show
        $category = $instance['category'];
        // Category to show
        if ($category == "All") {
            $category = "all";
        }
        if ($category == "all") {
            $category = '';
        }
        $category_slug = str_replace('_', '-', $category);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $recent_portfolio = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => $number, 'portfolio-category' => $category_slug));
        $count = 0;
        if ($recent_portfolio->have_posts()) {
            ?>
			
			<ul class="portfolio-grid">
				
				<?php 
            while ($recent_portfolio->have_posts()) {
                $recent_portfolio->the_post();
                $post_title = get_the_title();
                $post_permalink = get_permalink();
                $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
                foreach ($thumb_image as $detail_image) {
                    $thumb_img_url = $detail_image['url'];
                    break;
                }
                if (!$thumb_image) {
                    $thumb_image = get_post_thumbnail_id();
                    $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
                }
                $image = sf_aq_resize($thumb_img_url, 85, 85, true, false);
                ?>
				<?php 
                if ($image) {
                    ?>
				<li class="grid-item-<?php 
                    echo $count;
                    ?>
">
					<a href="<?php 
                    echo $post_permalink;
                    ?>
" class="grid-image">
						<img src="<?php 
                    echo $image[0];
                    ?>
" width="<?php 
                    echo $image[1];
                    ?>
" height="<?php 
                    echo $image[2];
                    ?>
" alt="<?php 
                    echo $post_title;
                    ?>
" />
						<span class="tooltip"><?php 
                    echo $post_title;
                    ?>
<span class="arrow"></span></span>
					</a>
				</li>
				<?php 
                }
                ?>
				
				<?php 
                $count++;
                wp_reset_query();
            }
            ?>
			</ul>
				
			<?php 
        }
        ?>
			
			
			<?php 
        echo $after_widget;
    }
开发者ID:part-up,项目名称:blog,代码行数:94,代码来源:widget-portfolio-grid.php


示例6: sf_portfolio_related

    function sf_portfolio_related()
    {
        global $post;
        $related = sf_portfolio_related_posts($post->ID);
        if ($related->have_posts()) {
            ?>
		
			<div class="container">
			
				<div class="related-projects clearfix">
					
					<h3 class="spb-heading"><span><?php 
            _e("Related Projects", "swiftframework");
            ?>
</span></h3>
					
					<ul class="row">
					<?php 
            while ($related->have_posts()) {
                $related->the_post();
                ?>
					    	<?php 
                $item_title = get_the_title();
                $thumb_image = "";
                $thumb_image = sf_get_post_meta($post->ID, 'sf_thumbnail_image', true);
                if ($thumb_image == "") {
                    $thumb_image = get_post_thumbnail_id($post->ID);
                }
                $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
                if ($thumb_img_url == "") {
                    $thumb_img_url = "default";
                }
                $image = sf_aq_resize($thumb_img_url, 300, 225, true, false);
                ?>
					    	
					        <li class="col-sm-3">
					        	<figure class="animated-overlay">
					        		<img src="<?php 
                echo $image[0];
                ?>
" width="<?php 
                echo $image[1];
                ?>
" height="<?php 
                echo $image[2];
                ?>
" alt="<?php 
                echo $item_title;
                ?>
" />
					        		<a href="<?php 
                the_permalink();
                ?>
"></a>
					        		<figcaption>
					        			<div class="thumb-info">						
					        				<h4><?php 
                echo $item_title;
                ?>
</h4>
				        					<i class="ss-navigateright"></i>
					        			</div>
					        		</figcaption>
					        	</figure>
					        </li>
					    <?php 
            }
            ?>
					</ul>
					
				</div>
				
				</div>
			
			<?php 
        }
        ?>
		
								
		<?php 
    }
开发者ID:part-up,项目名称:blog,代码行数:81,代码来源:sf-portfolio-detail.php


示例7: while

					<?php 
        while ($related->have_posts()) {
            $related->the_post();
            ?>
					    	<?php 
            $item_title = get_the_title();
            $thumb_image = "";
            $thumb_image = sf_get_post_meta($post->ID, 'sf_thumbnail_image', true);
            if ($thumb_image == "") {
                $thumb_image = get_post_thumbnail_id($post->ID);
            }
            $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
            if ($thumb_img_url == "") {
                $thumb_img_url = "default";
            }
            $image = sf_aq_resize($thumb_img_url, 300, 225, true, false);
            ?>
					    	
					        <li class="col-sm-3">
					        	<figure class="animated-overlay">
					        		<img src="<?php 
            echo $image[0];
            ?>
" width="<?php 
            echo $image[1];
            ?>
" height="<?php 
            echo $image[2];
            ?>
" alt="<?php 
            echo $item_title;
开发者ID:jamesvillarrubia,项目名称:uniken-web,代码行数:31,代码来源:single-portfolio.php


示例8: sf_portfolio_items


//.........这里部分代码省略.........
                         } else {
                             $link_config = 'href="' . $permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         /* ITEM OUTPUT
         			================================================== */
         $portfolio_items_output .= '<li itemscope itemtype="http://schema.org/CreativeWork" data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' ' . $term_slug . '">' . "\n";
         /* THUMBNAIL CONFIG
         			================================================== */
         if ($thumb_type != "none") {
             if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
                 $portfolio_items_output .= '<figure class="animated-overlay">' . "\n";
             } else {
                 $portfolio_items_output .= '<figure class="animated-overlay overlay-alt">' . "\n";
             }
             if ($thumb_type == "video") {
                 $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
                 $portfolio_items_output .= $video;
             } else {
                 if ($thumb_type == "slider") {
                     $portfolio_items_output .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n";
                     foreach ($thumb_gallery as $image) {
                         $portfolio_items_output .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n";
                     }
                     $portfolio_items_output .= '</ul></div>' . "\n";
                 } else {
                     if ($thumb_type == "image" && $thumb_img_url == "") {
                         $thumb_img_url = "default";
                     }
                     $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                     if ($image) {
                         $portfolio_items_output .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />' . "\n";
                         $portfolio_items_output .= '<a ' . $link_config . '></a>';
                         if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) {
                             $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-extended">';
                         } else {
                             if ($display_type == "standard" || $display_type == "masonry" || $display_type == "masonry-fw") {
                                 $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-alt">';
                             } else {
                                 if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw")) {
                                     $portfolio_items_output .= '<figcaption><div class="thumb-info thumb-info-excerpt">';
                                 } else {
                                     $portfolio_items_output .= '<figcaption><div class="thumb-info">';
                                 }
                             }
                         }
                         if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "masonry-gallery-fw") {
                             if ($hover_show_excerpt == "yes") {
                                 $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>';
                                 $portfolio_items_output .= '<div itemprop="description">' . $post_excerpt . '</div>';
                             } else {
                                 $portfolio_items_output .= '<h4 itemprop="name headline">' . $item_title . '</h4>';
                                 $portfolio_items_output .= '<h5 itemprop="name alternative">' . $item_subtitle . '</h5>';
                             }
                         }
                         $portfolio_items_output .= '<i class="' . $item_icon . '"></i>';
                         $portfolio_items_output .= '</div></figcaption>';
                     }
                 }
             }
             $portfolio_items_output .= '</figure>' . "\n";
         }
开发者ID:roycocup,项目名称:enclothed,代码行数:67,代码来源:sf-portfolio.php


示例9: sf_nextprev_navigation

    function sf_nextprev_navigation()
    {
        global $sf_options;
        // Pagiantion style
        $pagination_style = "standard";
        if (isset($sf_options['pagination_style'])) {
            $pagination_style = $sf_options['pagination_style'];
        }
        // Portfolio category navigation
        $enable_category_navigation = $sf_options['enable_category_navigation'];
        if (!(is_singular('post') || is_singular('portfolio') || is_singular('product')) || $pagination_style != "fs-arrow" || !sf_theme_supports('fullscreen-pagination')) {
            return;
        }
        $taxonomy = "category";
        if (is_singular('portfolio')) {
            $taxonomy = "portfolio-category";
        } else {
            if (is_singular('product')) {
                $taxonomy = "product_cat";
            }
        }
        // Get next/prev post
        $prev_post = get_next_post($enable_category_navigation, '', $taxonomy);
        $next_post = get_previous_post($enable_category_navigation, '', $taxonomy);
        $sf_prev_icon = apply_filters('sf_prev_icon', '<i class="ss-navigateleft"></i>');
        $sf_next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
        if (!empty($prev_post)) {
            $postID = $prev_post->ID;
            $prev_permalink = get_permalink($postID);
            $item_subtitle = sf_get_post_meta($postID, 'sf_portfolio_subtitle', true);
            $use_thumb_content = sf_get_post_meta($postID, 'sf_thumbnail_content_main_detail', true);
            $image = $media_image_url = $image_id = "";
            if ($use_thumb_content) {
                $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $postID);
            } else {
                $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full', $postID);
            }
            foreach ($media_image as $detail_image) {
                $image_id = $detail_image['ID'];
                $media_image_url = $detail_image['url'];
                break;
            }
            if (!$media_image) {
                $media_image = get_post_thumbnail_id($postID);
                $image_id = $media_image;
                $media_image_url = wp_get_attachment_url($media_image, 'full');
            }
            $detail_image = sf_aq_resize($media_image_url, 80, 80, true, false);
            $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true);
            if ($detail_image) {
                $image = '<img itemprop="image" src="' . $detail_image[0] . '" width="' . $detail_image[1] . '" height="' . $detail_image[2] . '" alt="' . $image_alt . '" />';
            }
            ?>

				<?php 
            if ($image != "") {
                ?>
				<div id="prev-article-pagination" class="window-arrow-nav prev-item has-img">
				<?php 
            } else {
                ?>
				<div id="prev-article-pagination" class="window-arrow-nav prev-item">
				<?php 
            }
            ?>

					<a href="<?php 
            echo esc_url($prev_permalink);
            ?>
">
						<div class="nav-transition">
							<div class="overlay-wrap">
								<?php 
            echo esc_html($sf_prev_icon);
            ?>
								<?php 
            if ($image != "") {
                ?>
								<figure class="pagination-article-image">
									<?php 
                echo esc_html($image);
                ?>
								</figure>
								<?php 
            }
            ?>
							</div>
						</div>

						<?php 
            if ($item_subtitle != "") {
                ?>
						<div class="pagination-article-details has-subtitle">
							<h5><?php 
                echo esc_attr($prev_post->post_title);
                ?>
</h5>
							<p><?php 
                echo esc_attr($item_subtitle);
                ?>
//.........这里部分代码省略.........
开发者ID:shimion,项目名称:wishlistshimion,代码行数:101,代码来源:sf-theme-functions.php


示例10: sf_get_search_item

 function sf_get_search_item($postID)
 {
     $search_item = $thumb_img_url = $post_excerpt = $img_icon = "";
     $post_format = get_post_format($postID);
     if ($post_format == "") {
         $post_format = 'standard';
     }
     $post_type = get_post_type($postID);
     if ($post_type == "post") {
         if ($post_format == "quote" || $post_format == "status") {
             $img_icon = "ss-quote";
         } else {
             if ($post_format == "image") {
                 $img_icon = "ss-picture";
             } else {
                 if ($post_format == "chat") {
                     $img_icon = "ss-chat";
                 } else {
                     if ($post_format == "audio") {
                         $img_icon = "ss-music";
                     } else {
                         if ($post_format == "video") {
                             $img_icon = "ss-video";
                         } else {
                             if ($post_format == "link") {
                                 $img_icon = "ss-link";
                             } else {
                                 $img_icon = "ss-pen";
                             }
                         }
                     }
                 }
             }
         }
     } else {
         if ($post_type == "product") {
             $img_icon = "ss-cart";
         } else {
             if ($post_type == "portfolio") {
                 $img_icon = "ss-picture";
             } else {
                 if ($post_type == "team") {
                     $img_icon = "ss-user";
                 } else {
                     if ($post_type == "galleries") {
                         $img_icon = "ss-picture";
                     } else {
                         $img_icon = "ss-file";
                     }
                 }
             }
         }
     }
     $post_title = get_the_title();
     $post_date = get_the_date();
     $post_permalink = get_permalink();
     $custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true);
     $post_excerpt = strip_shortcodes(get_the_excerpt());
     $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=thumbnail');
     foreach ($thumb_image as $detail_image) {
         $thumb_img_url = $detail_image['url'];
         break;
     }
     if (!$thumb_image) {
         $thumb_image = get_post_thumbnail_id();
         $thumb_img_url = wp_get_attachment_url($thumb_image, 'thumbnail');
     }
     $image = sf_aq_resize($thumb_img_url, 70, 70, true, false);
     $image_title = sf_featured_img_title();
     if ($image) {
         $search_item .= '<div class="search-item-img"><a href="' . $post_permalink . '"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_title . '" /></a></div>';
     } else {
         $search_item .= '<div class="search-item-img"><a href="' . $post_permalink . '" class="img-holder"><i class="' . $img_icon . '"></i></a></div>';
     }
     if ($post_excerpt == "<p></p>") {
         $search_item .= '<div class="search-item-content no-excerpt">';
         $search_item .= '<h3><a href="' . $post_permalink . '">' . $post_title . '</a></h3>';
         $search_item .= '<time>' . $post_date . '</time>';
         $search_item .= '</div>';
     } else {
         $search_item .= '<div class="search-item-content">';
         $search_item .= '<h3><a href="' . $post_permalink . '">' . $post_title . '</a></h3>';
         $search_item .= '<time>' . $post_date . '</time>';
         $search_item .= '<div class="excerpt">' . $post_excerpt . '</div>';
         $search_item .= '</div>';
     }
     return $search_item;
 }
开发者ID:Infernosaint,项目名称:WPSetupTest2,代码行数:88,代码来源:sf-post-formats.php


示例11: widget

    function widget($args, $instance)
    {
        global $post, $sf_options;
        extract($args);
        $remove_dates = $sf_options['remove_dates'];
        // Widget Options
        $title = apply_filters('widget_title', $instance['title']);
        // Title
        $post_id = $instance['post_id'];
        // Post ID
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (function_exists('icl_object_id')) {
            $post_id = icl_object_id($post_id, 'post', true);
        }
        $infocus_post = get_post($post_id);
        ?>

            <div class="infocus-item">

                <?php 
        $post_title = $infocus_post->post_title;
        $post_permalink = get_post_permalink($infocus_post);
        $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id);
        $thumb_video = sf_get_post_meta($post_id, 'sf_thumbnail_video_url', true);
        foreach ($thumb_image as $detail_image) {
            $thumb_img_url = $detail_image['url'];
            break;
        }
        if (!$thumb_image) {
            $thumb_image = get_post_thumbnail_id($post_id);
            $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
        }
        $image = sf_aq_resize($thumb_img_url, 300, 225, true, false);
        $image_alt = esc_attr(sf_get_post_meta($thumb_image, '_wp_attachment_image_alt', true));
        ?>
                <figure class="animated-overlay overlay-alt">

                	<?php 
        if (sf_theme_opts_name() == "sf_atelier_options") {
            $post_date_month = get_the_date('M');
            $post_date_day = get_the_date('d');
            ?>
                	<div class="date-overlay narrow-date-block"><span class="month"><?php 
            echo $post_date_month;
            ?>
</span><span class="day"><?php 
            echo $post_date_day;
            ?>
</span></div>
                	<?php 
        }
        ?>

                    <?php 
        if ($thumb_video != "") {
            ?>
                        <?php 
            echo sf_video_embed($thumb_video, 300, 200);
            ?>
                    <?php 
        } else {
            if ($image) {
                ?>
                        <img src="<?php 
                echo $image[0];
                ?>
" width="<?php 
                echo $image[1];
                ?>
"
                             height="<?php 
                echo $image[2];
                ?>
" alt="<?php 
                echo $image_alt;
                ?>
"/>
                        <a href="<?php 
                echo $post_permalink;
                ?>
" class="infocus-image"></a>
                        <div class="figcaption-wrap"></div>
                        <figcaption>
                            <div class="thumb-info thumb-info-alt">
                                <?php 
                echo apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
                ?>
                            </div>
                        </figcaption>
                    <?php 
            }
        }
        ?>
                </figure>

                <div class="infocus-title clearfix">

//.........这里部分代码省略.........
开发者ID:arobbins,项目名称:spellestate,代码行数:101,代码来源:widget-infocus.php


示例12: content

 protected function content($atts, $content = null)
 {
     $title = $show_hide = $width = $item_class = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', "category" => 'all', 'excerpt_length' => '60', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $args = array('post_type' => 'team', 'post_status' => 'publish', 'team-category' => $category_slug, 'posts_per_page' => -1, 'ignore_sticky_posts' => 1, 'no_found_rows' => 1);
     $team_members = query_posts($args);
     $count = $columns = 0;
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     if (is_singular('portfolio')) {
         $sidebar_config = "no-sidebars";
     }
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $item_class = 'span2';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $item_class = 'span-bs-quarter';
         } else {
             $item_class = 'span3';
         }
     }
     if ($width == "1/4") {
         $columns = 1;
     } else {
         if ($width == "1/2") {
             $columns = 2;
         } else {
             if ($width == "3/4") {
                 $columns = 3;
             } else {
                 $columns = 4;
             }
         }
     }
     $list_class = '';
     if ($show_hide == "yes") {
         $list_class = 'has-show-hide';
     }
     if (have_posts()) {
         $items .= '<div class="carousel-overflow"><ul id="carousel-' . $sf_carouselID . '" class="team-members carousel-items ' . $list_class . ' clearfix" data-columns="' . $columns . '" data-auto="false">';
         while (have_posts()) {
             the_post();
             $member_name = get_the_title();
             $member_position = sf_get_post_meta($post->ID, 'sf_team_member_position', true);
             $member_bio = sf_excerpt($excerpt_length);
             $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
             if ($custom_excerpt != "") {
                 $member_bio = sf_custom_excerpt($custom_excerpt, 1000);
             }
             $member_twitter = sf_get_post_meta($post->ID, 'sf_team_member_twitter', true);
             $member_facebook = sf_get_post_meta($post->ID, 'sf_team_member_facebook', true);
             $member_linkedin = sf_get_post_meta($post->ID, 'sf_team_member_linkedin', true);
             $member_google_plus = sf_get_post_meta($post->ID, 'sf_team_member_google_plus', true);
             $member_skype = sf_get_post_meta($post->ID, 'sf_team_member_skype', true);
             $member_instagram = sf_get_post_meta($post->ID, 'sf_team_member_instagram', true);
             $member_dribbble = sf_get_post_meta($post->ID, 'sf_team_member_dribbble', true);
             $member_image = get_post_thumbnail_id();
             $items .= '<li itemscope data-id="id-' . $count . '" class="clearfix carousel-item team-member ' . $item_class . '">';
             $img_url = wp_get_attachment_url($member_image, 'full');
             $image = sf_aq_resize($img_url, 270, 270, true, false);
             $items .= '<figure class="standard-style">';
             if ($image) {
                 $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />';
             }
             if ($member_twitter != "" || $member_facebook != "" || $member_linkedin != "" || $member_google_plus != "" || $member_skype != "" || $member_instagram != "" || $member_dribbble != "") {
                 $items .= '<figcaption><span>' . __("Follow:", "swiftframework") . '</span><ul class="social-icons">';
                 if ($member_twitter != "") {
                     $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sf_breadcrumbs函数代码示例发布时间:2022-05-24
下一篇:
PHP sf_api函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap