当前位置: 首页>>代码示例>>PHP>>正文


PHP sf_video_embed函数代码示例

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


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

示例1: content

 protected function content($atts, $content = null)
 {
     $title = $link = $size = $el_position = $full_width = $width = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'link' => '', 'size' => '1280x720', 'el_position' => '', 'width' => '1/1', 'full_width' => 'no', 'el_class' => ''), $atts));
     $output = '';
     if ($link == '') {
         return null;
     }
     $video_h = '';
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $size = str_replace(array('px', ' '), array('', ''), $size);
     $size = explode("x", $size);
     $video_w = $size[0];
     if (count($size) > 1) {
         $video_h = $size[1];
     }
     $embed = sf_video_embed($link, $video_w, $video_h);
     if ($full_width == "yes") {
         $output .= "\n\t" . '<div class="spb_video_widget full-width spb_content_element ' . $width . $el_class . '">';
     } else {
         $output .= "\n\t" . '<div class="spb_video_widget spb_content_element ' . $width . $el_class . '">';
     }
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : '';
     $output .= $embed;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
开发者ID:arobbins,项目名称:spellestate,代码行数:31,代码来源:media.php

示例2: content


//.........这里部分代码省略.........
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">';
         $items .= '<figure class="animated-overlay overlay-alt">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, 270, 202);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, 420, 315, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $link_config . '></a>';
                     if ($show_title == "yes") {
                         $items .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     } else {
                         $items .= '<figcaption><div class="thumb-info">';
                         $items .= '<h4>' . $item_title . '</h4>';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     }
                 }
             }
开发者ID:VeritasStrategies,项目名称:Poplin,代码行数:67,代码来源:posts-carousel.php

示例3: sf_portfolio_detail_media

    function sf_portfolio_detail_media($extra_class)
    {
        global $post;
        $media_type = $media_image = $media_video = $media_gallery = '';
        $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
        $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true);
        $hide_details = sf_get_post_meta($post->ID, 'sf_hide_details', true);
        $show_social = sf_get_post_meta($post->ID, 'sf_social_sharing', true);
        $item_categories = get_the_term_list($post->ID, 'portfolio-category', '<li>', '</li><li>', '</li>');
        $item_link = sf_get_post_meta($post->ID, 'sf_portfolio_external_link', true);
        if ($use_thumb_content) {
            $media_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
            $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
            $media_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-onecol');
        } else {
            $media_type = sf_get_post_meta($post->ID, 'sf_detail_type', true);
            $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_detail_video_url', true);
            $media_gallery = rwmb_meta('sf_detail_gallery', 'type=image&size=thumb-image-onecol');
            $media_slider = sf_get_post_meta($post->ID, 'sf_detail_rev_slider_alias', true);
            $media_layerslider = sf_get_post_meta($post->ID, 'sf_detail_layer_slider_alias', true);
            $custom_media = sf_get_post_meta($post->ID, 'sf_custom_media', true);
        }
        foreach ($media_image as $detail_image) {
            $media_image_url = $detail_image['url'];
            $share_image_url = $media_image_url;
            break;
        }
        if (!$media_image) {
            $media_image = get_post_thumbnail_id();
            $media_image_url = wp_get_attachment_url($media_image, 'full');
            $share_image_url = $media_image_url;
        }
        $image_caption = $image_alt = $image_title = "";
        $image_meta = sf_get_attachment_meta($media_image);
        if (isset($image_meta)) {
            $image_caption = esc_attr($image_meta['caption']);
            $image_title = esc_attr($image_meta['title']);
            $image_alt = esc_attr($image_meta['alt']);
        }
        // META VARIABLES
        $media_width = 850;
        $video_height = 638;
        if ($fw_media_display) {
            $media_width = 2000;
            $video_height = 800;
        }
        $media_height = NULL;
        ?>
			<figure class="media-wrap <?php 
        echo $extra_class;
        ?>
">
				<?php 
        if ($media_type == "video") {
            ?>
					
					<?php 
            echo sf_video_embed($media_video, $media_width, $video_height);
            ?>
					
				<?php 
        } else {
            if ($media_type == "slider") {
                ?>
					
					<div class="flexslider item-slider">
						<ul class="slides">
						<?php 
                foreach ($media_gallery as $image) {
                    echo "<li>";
                    if (!empty($image['caption'])) {
                        echo "<p class='flex-caption'>{$image['caption']}</p>";
                    }
                    echo "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />";
                    echo "</li>";
                }
                ?>
										
						</ul>
					</div>
					
				<?php 
            } else {
                if ($media_type == "layer-slider") {
                    ?>
					
					<div class="layerslider">
						
						<?php 
                    if ($media_slider != "") {
                        echo do_shortcode('[rev_slider ' . $media_slider . ']');
                    } else {
                        echo do_shortcode('[layerslider id="' . $media_layerslider . '"]');
                    }
                    ?>
						
					</div>
						
//.........这里部分代码省略.........
开发者ID:part-up,项目名称:blog,代码行数:101,代码来源:sf-portfolio-detail.php

示例4: widget

    function widget($args, $instance)
    {
        global $post;
        extract($args);
        // 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;
        }
        $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);
        ?>
				<figure class="animated-overlay overlay-alt">
					<?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];
                ?>
" />
						<a href="<?php 
                echo $post_permalink;
                ?>
" class="infocus-image"></a>
						<figcaption>
							<div class="thumb-info thumb-info-alt">
								<i class="ss-navigateright"></i>
							</div>
						</figcaption>
					<?php 
            }
        }
        ?>
				</figure>
								
				<div class="infocus-title clearfix">
					<h5><a href="<?php 
        echo $post_permalink;
        ?>
" title="<?php 
        echo $post_title;
        ?>
"><?php 
        echo $post_title;
        ?>
</a></h5>
					<div class="comments-likes">
					<?php 
        if (function_exists('lip_love_it_link')) {
            echo lip_love_it_link($post_id, '<i class="ss-heart"></i>', '<i class="ss-heart"></i>', false);
        }
        ?>
					</div>
				</div>
				
			</div>
							
			<?php 
        echo $after_widget;
    }
开发者ID:EmmaTope,项目名称:SolidSteps,代码行数:94,代码来源:widget-infocus.php

示例5: sf_video_embed

                ?>
						<figure class="media-wrap col-sm-9">
						<?php 
            } else {
                ?>
						<figure class="media-wrap col-sm-12">
						<?php 
            }
            ?>
								
						<?php 
            if ($media_type == "video") {
                ?>
							
							<?php 
                echo sf_video_embed($media_video, $media_width, $video_height);
                ?>
							
						<?php 
            } else {
                if ($media_type == "slider") {
                    ?>
							
							<div class="flexslider item-slider">
								
								<ul class="slides">
										
								<?php 
                    foreach ($media_gallery as $image) {
                        echo "<li>";
                        if (!empty($image['caption'])) {
开发者ID:jamesvillarrubia,项目名称:uniken-web,代码行数:31,代码来源:single-portfolio.php

示例6: sf_portfolio_items


//.........这里部分代码省略.........
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         if ($enable_portfolio_gallery) {
                             $link_config = 'href="' . $lightbox_image_url . '" class="view" rel="item-gallery"';
                         } else {
                             $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                         }
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } 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>';
开发者ID:roycocup,项目名称:enclothed,代码行数:67,代码来源:sf-portfolio.php

示例7: sf_portfolio_detail_media

    function sf_portfolio_detail_media()
    {
        global $post, $sf_options;
        $media_type = $media_image = $media_video = $media_audio = $media_mp4 = $media_ogg = $media_webm = $media_gallery = $image_alt = '';
        $default_detail_media = $sf_options['default_detail_media'];
        $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
        $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true);
        $hide_details = sf_get_post_meta($post->ID, 'sf_hide_details', true);
        $show_social = sf_get_post_meta($post->ID, 'sf_social_sharing', true);
        $item_categories = get_the_term_list($post->ID, 'portfolio-category', '<li>', '</li><li>', '</li>');
        $item_link = sf_get_post_meta($post->ID, 'sf_portfolio_external_link', true);
        $custom_media_height = sf_get_post_meta($post->ID, 'sf_media_height', true);
        if ($use_thumb_content) {
            $media_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
            $media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
            $media_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-onecol');
            $media_mp4 = sf_get_post_meta($post->ID, 'sf_thumbnail_video_mp4', true);
            $media_ogg = sf_get_post_meta($post->ID, 'sf_thumbnail_video_ogg', true);
            $media_webm = sf_get_post_meta($post->ID, 'sf_thumbnail_video_webm', true);
        } else {
            $media_type = sf_get_post_meta($post->ID, 'sf_detail_type', true);
            $media_image = rwmb_meta('sf_detail_image', 'type=image&size=full');
            $media_video = sf_get_post_meta($post->ID, 'sf_detail_video_url', true);
            $media_gallery = rwmb_meta('sf_detail_gallery', 'type=image&size=thumb-image-onecol');
            $media_slider = sf_get_post_meta($post->ID, 'sf_detail_rev_slider_alias', true);
            $media_layerslider = sf_get_post_meta($post->ID, 'sf_detail_layer_slider_alias', true);
            $custom_media = sf_get_post_meta($post->ID, 'sf_custom_media', true);
            $media_audio = sf_get_post_meta($post->ID, 'sf_detail_audio_url', true);
            $media_mp4 = sf_get_post_meta($post->ID, 'sf_detail_video_mp4', true);
            $media_ogg = sf_get_post_meta($post->ID, 'sf_detail_video_ogg', true);
            $media_webm = sf_get_post_meta($post->ID, 'sf_detail_video_webm', true);
        }
        if ($media_type == "") {
            $media_type = $default_detail_media;
        }
        foreach ($media_image as $detail_image) {
            $media_image_url = $detail_image['url'];
            $share_image_url = $media_image_url;
            $image_alt = esc_attr(sf_get_post_meta($detail_image['ID'], '_wp_attachment_image_alt', true));
            break;
        }
        if (!$media_image) {
            $media_image = get_post_thumbnail_id();
            $media_image_url = wp_get_attachment_url($media_image, 'full');
            $share_image_url = $media_image_url;
            $image_alt = esc_attr(sf_get_post_meta($media_image, '_wp_attachment_image_alt', true));
        }
        // META VARIABLES
        $media_width = 850;
        $video_height = 638;
        if ($fw_media_display) {
            $media_width = 2000;
            $video_height = 1125;
        }
        $media_height = null;
        if ($custom_media_height != "") {
            $media_height = $custom_media_height;
        }
        ?>

            <?php 
        if ($fw_media_display == "fw-media") {
            ?>
                <figure class="media-wrap fw-media-wrap media-type-<?php 
            echo esc_attr($media_type);
            ?>
">
            <?php 
        } else {
            if ($fw_media_display == "split") {
                ?>
                <figure class="media-wrap col-sm-9 media-type-<?php 
                echo esc_attr($media_type);
                ?>
">
            <?php 
            } else {
                ?>
                <figure class="media-wrap container media-type-<?php 
                echo esc_attr($media_type);
                ?>
">
            <?php 
            }
        }
        ?>

            <?php 
        if ($media_type == "video") {
            ?>

                <?php 
            echo sf_video_embed($media_video, $media_width, $video_height);
            ?>

            <?php 
        } else {
            if ($media_type == "slider") {
                ?>
//.........这里部分代码省略.........
开发者ID:shimion,项目名称:wishlistshimion,代码行数:101,代码来源:sf-portfolio-detail.php

示例8: content

 protected function content($atts, $content = null)
 {
     $options = get_option('sf_dante_options');
     $title = $width = $excerpt_length = $item_class = $offset = $el_class = $output = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'item_columns' => '3', "item_count" => '4', "category" => '', "offset" => 0, "posts_order" => 'ASC', "excerpt_length" => '20', '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;
     $args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $blog_items = query_posts($args);
     if ($item_columns == "1") {
         $item_class = 'col-sm-12';
     } else {
         if ($item_columns == "2") {
             $item_class = 'col-sm-6';
         } else {
             if ($item_columns == "3") {
                 $item_class = 'col-sm-4';
             } else {
                 $item_class = 'col-sm-3';
             }
         }
     }
     if (have_posts()) {
         $items .= '<ul class="recent-posts row clearfix">';
         while (have_posts()) {
             the_post();
             $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
             $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
             $thumb_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
             $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
             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');
             }
             $item_title = get_the_title();
             $post_author = get_the_author_link();
             $post_date = get_the_date();
             $post_permalink = get_permalink();
             $post_comments = get_comments_number();
             $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
             $post_excerpt = '';
             if ($custom_excerpt != '') {
                 $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
             } else {
                 $post_excerpt = sf_excerpt($excerpt_length);
             }
             $thumb_link_type = sf_get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
             $thumb_link_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
             $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
             $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
             $thumb_lightbox_video_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
             $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
             $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
             $link_config = "";
             if ($thumb_link_type == "link_to_url") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "link_to_url_nw") {
                     $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                     $item_icon = "ss-link";
                 } else {
                     if ($thumb_link_type == "lightbox_thumb") {
                         $link_config = 'href="' . $thumb_img_url . '" class="view"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_image") {
                             $lightbox_image_url = '';
                             foreach ($thumb_lightbox_image as $image) {
                                 $lightbox_image_url = $image['full_url'];
                             }
                             $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                             $item_icon = "ss-view";
                         } else {
                             if ($thumb_link_type == "lightbox_video") {
                                 $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                                 $item_icon = "ss-video";
                             } else {
                                 $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                                 $item_icon = "ss-navigateright";
                             }
                         }
                     }
                 }
             }
             $items .= '<li itemscope class="recent-post ' . $item_class . ' clearfix">';
             $items .= '<figure class="animated-overlay overlay-alt">';
             if ($thumb_type == "video") {
                 $video = sf_video_embed($thumb_video, 270, 202);
//.........这里部分代码省略.........
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:101,代码来源:recent-posts.php

示例9: sf_get_recent_post_item


//.........这里部分代码省略.........
                 $item_icon = apply_filters('sf_post_lightbox_icon', "ss-view");
             } else {
                 if ($thumb_link_type == "lightbox_image") {
                     $lightbox_image_url = '';
                     foreach ($thumb_lightbox_image as $image) {
                         $lightbox_image_url = $image['full_url'];
                     }
                     $lightbox_id = rand();
                     if ($lightbox_image_url != "") {
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $lightbox_id . ']"';
                     }
                     $item_icon = apply_filters('sf_post_lightbox_icon', "ss-view");
                 } else {
                     if ($thumb_link_type == "lightbox_video") {
                         $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                         $item_icon = apply_filters('sf_post_video_icon', "ss-video");
                     } else {
                         $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                         $item_icon = apply_filters('sf_post_standard_icon', "ss-navigateright");
                     }
                 }
             }
         }
     }
     if ($thumb_type == "none") {
         $recent_post .= '<div itemscope class="recent-post no-thumb ' . $item_class . ' clearfix">';
     } else {
         $recent_post .= '<div itemscope class="recent-post has-thumb ' . $item_class . ' clearfix">';
     }
     $recent_post_figure .= '<div class="figure-wrap">';
     $recent_post_figure .= apply_filters('sf_before_recent_post_thumb', '');
     $recent_post_figure .= '<figure class="animated-overlay overlay-alt">';
     if ($thumb_type == "video") {
         $video = sf_video_embed($thumb_video, 400, 225);
         $recent_post_figure .= '<div class="video-thumb">' . $video . '</div>';
     } else {
         if ($thumb_type == "slider") {
             $recent_post_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
             foreach ($thumb_gallery as $image) {
                 $alt = $image['alt'];
                 if (!$alt) {
                     $alt = $image['title'];
                 }
                 $recent_post_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
             }
             $recent_post_figure .= '</ul></div>';
         } else {
             if ($thumb_img_url == "" && $thumb_type != "none") {
                 $thumb_img_url = "default";
             }
             $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
             if ($image) {
                 $recent_post_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                 $recent_post_figure .= '<a ' . $link_config . '></a>';
                 $recent_post_figure .= '<div class="figcaption-wrap"></div>';
                 if ($display_type == "showcase") {
                     $recent_post_figure .= '<figcaption><div class="thumb-info">';
                     $recent_post_figure .= '<h5><span class="post-date updated">' . $post_date . '</span></h5>';
                     $recent_post_figure .= '<h4>' . $item_title . '</h4>';
                     $recent_post_figure .= '</div></figcaption>';
                 } else {
                     $recent_post_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                     $recent_post_figure .= '<i class="' . $item_icon . '"></i>';
                     $recent_post_figure .= '</div></figcaption>';
                 }
             }
开发者ID:Infernosaint,项目名称:WPSetupTest2,代码行数:67,代码来源:sf-post-formats.php

示例10: 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

示例11: sf_get_post_item


//.........这里部分代码省略.........
         $item_icon = "ss-link";
     } else {
         if ($thumb_link_type == "link_to_url_nw") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "lightbox_thumb") {
                 $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                 $item_icon = "ss-view";
             } else {
                 if ($thumb_link_type == "lightbox_image") {
                     $lightbox_image_url = '';
                     foreach ($thumb_lightbox_image as $image) {
                         $lightbox_image_url = $image['full_url'];
                     }
                     $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_video") {
                         $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                         $item_icon = "ss-video";
                     } else {
                         $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                         $item_icon = "ss-navigateright";
                     }
                 }
             }
         }
     }
     // THUMBNAIL MEDIA TYPE SETUP
     if ($thumb_type != "none") {
         $item_figure .= '<figure class="animated-overlay overlay-alt">';
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
             $item_figure .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $item_figure .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>";
                 }
                 $item_figure .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_image = get_post_thumbnail_id($postID);
                     $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
                 }
                 $image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                 $thumbnail_id = get_post_thumbnail_id($postID);
                 $image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true);
                 if ($image) {
                     $item_figure .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />';
                     $item_figure .= '<a ' . $link_config . '></a>';
                     $item_figure .= '<figcaption><div class="thumb-info thumb-info-alt">';
                     $item_figure .= '<i class="' . $item_icon . '"></i>';
                     $item_figure .= '</div></figcaption>';
                 }
             }
         }
         $item_figure .= '</figure>';
     }
     // MASONRY STYLING
     if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
         $post_item .= '<div class="masonry-item-wrap">';
         if ($post_format == "quote") {
             $post_item .= '<div class="quote-excerpt heading-font entry-title" itemprop="description">' . $post_excerpt . '</div>';
开发者ID:VeritasStrategies,项目名称:Poplin,代码行数:67,代码来源:sf-post-formats.php

示例12: sf_portfolio_thumbnail


//.........这里部分代码省略.........
         $overlay_opacity = $sf_options['overlay_opacity'];
         if ($overlay_opacity == 100) {
             $overlay_opacity = '1';
         } else {
             $overlay_opacity = '0.' . $overlay_opacity;
         }
         $port_hover_bg_rgb = sf_hex2rgb($port_hover_bg_color);
         $port_hover_style = 'style="background-color:rgba(' . $port_hover_bg_rgb['red'] . ',' . $port_hover_bg_rgb['green'] . ',' . $port_hover_bg_rgb['blue'] . ',' . $overlay_opacity . ');"';
     }
     if ($port_hover_text_color != "") {
         $port_hover_text_style = 'style="color: ' . $port_hover_text_color . ';"';
     }
     foreach ($thumb_image as $detail_image) {
         $thumb_image_id = $detail_image['ID'];
         $thumb_img_url = $detail_image['url'];
         break;
     }
     if (!$thumb_image) {
         $thumb_image = get_post_thumbnail_id();
         $thumb_image_id = $thumb_image;
         $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
     }
     $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
     $image_alt = esc_attr(sf_get_post_meta($thumb_image_id, '_wp_attachment_image_alt', true));
     $item_title = get_the_title();
     $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
     $permalink = get_permalink();
     $item_link = sf_portfolio_item_link();
     $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
     $post_excerpt = '';
     if ($custom_excerpt != '') {
         $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
     } else {
         $post_excerpt = sf_excerpt($excerpt_length);
     }
     if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
         $portfolio_thumb .= '<figure class="animated-overlay overlay-style">' . "\n";
     } else {
         $portfolio_thumb .= '<figure class="animated-overlay overlay-alt">' . "\n";
     }
     if ($thumb_type == "video") {
         $video = sf_video_embed($thumb_video, $thumb_width, $video_height);
         $portfolio_thumb .= '<div class="video-thumb">' . $video . '</div>';
     } else {
         if ($thumb_type == "slider") {
             $portfolio_thumb .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n";
             foreach ($thumb_gallery as $image) {
                 $portfolio_thumb .= "<li><a " . $item_link['config'] . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n";
             }
             $portfolio_thumb .= '</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_thumb .= '<a ' . $item_link['config'] . '></a>';
                 if ($display_type == "multi-size-masonry") {
                     $portfolio_thumb .= '<div class="multi-masonry-img-wrap"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></div>' . "\n";
                 } else {
                     $portfolio_thumb .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" />' . "\n";
                 }
                 $portfolio_thumb .= '<div class="figcaption-wrap"></div>';
                 if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry")) {
                     $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                 } else {
                     if ($display_type == "standard" || $display_type == "masonry") {
                         $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-alt">';
                     } else {
                         if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery")) {
                             $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-excerpt">';
                         } else {
                             $portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                         }
                     }
                 }
                 if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
                     if ($hover_show_excerpt == "yes") {
                         $portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                         if ($post_excerpt != "") {
                             $portfolio_thumb .= '<div class="name-divide"></div>';
                             $portfolio_thumb .= '<div itemprop="description" ' . $port_hover_text_style . '>' . $post_excerpt . '</div>';
                         }
                     } else {
                         $portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                         if ($item_subtitle != "") {
                             $portfolio_thumb .= '<div class="name-divide"></div>';
                             $portfolio_thumb .= '<h5 itemprop="name alternativeHeadline" ' . $port_hover_text_style . '>' . $item_subtitle . '</h5>';
                         }
                     }
                 } else {
                     $portfolio_thumb .= '<i class="' . $item_link['icon'] . '"></i>';
                 }
                 $portfolio_thumb .= '</div></figcaption>';
             }
         }
     }
     $portfolio_thumb .= '</figure>' . "\n";
     return $portfolio_thumb;
 }
开发者ID:shimion,项目名称:wishlistshimion,代码行数:101,代码来源:sf-portfolio.php

示例13: content


//.........这里部分代码省略.........
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = sf_get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
         $port_hover_bg_color = sf_get_post_meta($post->ID, 'sf_port_hover_bg_color', true);
         $port_hover_text_color = sf_get_post_meta($post->ID, 'sf_port_hover_text_color', true);
         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');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $item_title = get_the_title();
         $item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
         $permalink = get_permalink();
         $item_link = sf_portfolio_item_link();
         if ($port_hover_bg_color != "") {
             $overlay_opacity = $sf_options['overlay_opacity'];
             if ($overlay_opacity == 100) {
                 $overlay_opacity = '1';
             } else {
                 $overlay_opacity = '0.' . $overlay_opacity;
             }
             $port_hover_bg_rgb = sf_hex2rgb($port_hover_bg_color);
             $port_hover_style = 'style="background-color:rgba(' . $port_hover_bg_rgb['red'] . ',' . $port_hover_bg_rgb['green'] . ',' . $port_hover_bg_rgb['blue'] . ',' . $overlay_opacity . ');"';
         }
         if ($port_hover_text_color != "") {
             $port_hover_text_style = 'style="color: ' . $port_hover_text_color . ';"';
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item portfolio-item">';
         $items .= '<figure class="animated-overlay overlay-style">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, $figure_width, $figure_height);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><a " . $item_link['config'] . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_type == "image" && $thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, $figure_width, $figure_height, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $item_link['config'] . '></a>';
                     $items .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
                     $items .= '<h4 ' . $port_hover_text_style . '>' . $item_title . '</h4>';
                     if ($item_subtitle != "") {
                         $items .= '<div class="name-divide"></div>';
                         $items .= '<h5 ' . $port_hover_text_style . '>' . $item_subtitle . '</h5>';
                     }
                     $items .= '</div></figcaption>';
                 }
             }
         }
         $items .= '</figure>';
         $items .= '</div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_portfolio_carousel_widget carousel-asset spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . '<div class="title-wrap clearfix">';
     if ($title != '') {
         $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
     }
     $output .= spb_carousel_arrows();
     $output .= '</div>';
     $output .= "\n\t\t" . $items;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
         $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
     } else {
         $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     }
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
开发者ID:Infernosaint,项目名称:WPSetupTest2,代码行数:101,代码来源:portfolio-carousel.php


注:本文中的sf_video_embed函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。