本文整理汇总了PHP中sf_get_embed_src函数的典型用法代码示例。如果您正苦于以下问题:PHP sf_get_embed_src函数的具体用法?PHP sf_get_embed_src怎么用?PHP sf_get_embed_src使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sf_get_embed_src函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
protected function content($atts, $content = null)
{
$options = get_option('sf_dante_options');
$title = $category = $item_class = $excerpt_length = $width = $offset = $el_class = $output = $filter = $items = $el_position = $item_count = '';
extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "offset" => '0', "posts_order" => 'ASC', "category" => 'all', '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++;
}
$blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'no_found_rows' => 1, 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
$blog_items = new WP_Query($blog_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;
}
}
}
$items .= '<div class="carousel-wrap">';
$items .= '<div id="carousel-' . $sf_carouselID . '" class="blog-items carousel-items clearfix" data-columns="' . $columns . '">';
while ($blog_items->have_posts()) {
$blog_items->the_post();
$item_title = get_the_title();
$post_author = get_the_author_link();
$post_date = get_the_date();
$post_comments = get_comments_number();
$post_category = get_the_category();
$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');
$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);
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();
$post_permalink = get_permalink();
$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 ($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="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) {
//.........这里部分代码省略.........
示例2: sf_fullscreen_video
function sf_fullscreen_video($atts, $content = null)
{
extract(shortcode_atts(array("type" => '', "imageurl" => '', "btntext" => '', "videourl" => '', "extraclass" => ''), $atts));
$fw_video_output = "";
$video_embed_url = sf_get_embed_src($videourl);
if ($type == "image-button") {
$fw_video_output .= '<a href="#" class="fw-video-link fw-video-link-image ' . $extraclass . '" data-video="' . $video_embed_url . '">';
$fw_video_output .= '<i class="ss-play"></i>';
$fw_video_output .= '<img src="' . $imageurl . '" alt="' . $btntext . '" />';
$fw_video_output .= '</a>';
} else {
if ($type == "text-button") {
$fw_video_output .= '<a href="#" class="fw-video-link fw-video-link-text sf-button sf-icon-stroke accent ' . $extraclass . '" data-video="' . $video_embed_url . '">';
$fw_video_output .= '<i class="ss-play"></i>';
$fw_video_output .= '<span class="text">' . $btntext . '</span>';
$fw_video_output .= '</a>';
} else {
$fw_video_output .= '<a href="#" class="fw-video-link fw-video-link-icon ' . $extraclass . '" data-video="' . $video_embed_url . '">';
$fw_video_output .= '<i class="ss-play"></i>';
$fw_video_output .= '</a>';
}
}
return $fw_video_output;
}
示例3: 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);
//.........这里部分代码省略.........
示例4: sf_portfolio_items
function sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars)
{
/* OUTPUT VARIABLE
================================================== */
$portfolio_items_output = "";
$count = 0;
/* CATEGORY SLUG MODIFICATION
================================================== */
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
/* PORTFOLIO QUERY SETUP
================================================== */
global $post, $wp_query;
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
$portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'paged' => $paged, 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'id', 'terms' => array($exclude_categories), 'operator' => 'NOT IN')));
$portfolio_items = new WP_Query($portfolio_args);
/* LIST CLASS CONFIG
================================================== */
$list_class = '';
if ($display_type == "masonry" || $display_type == "masonry-gallery") {
$list_class .= 'masonry-items filterable-items col-' . $columns . ' row clearfix';
} else {
if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
$list_class .= 'masonry-items masonry-fw filterable-items col-' . $columns . ' row clearfix';
} else {
if ($display_type == "gallery") {
$list_class .= 'gallery-portfolio filterable-items col-' . $columns . ' row clearfix';
} else {
$list_class .= 'standard-portfolio filterable-items col-' . $columns . ' row clearfix';
}
}
}
/* ITEMS OUTPUT
================================================== */
$options = get_option('sf_dante_options');
$enable_portfolio_gallery = $options['enable_portfolio_gallery'];
$portfolio_items_output .= '<ul class="portfolio-items ' . $list_class . '">' . "\n";
while ($portfolio_items->have_posts()) {
$portfolio_items->the_post();
/* META VARIABLES
================================================== */
$thumb_image = $thumb_gallery = $video = $item_class = $link_config = '';
$thumb_width = 420;
$thumb_height = 315;
$video_height = 315;
$thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true);
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
$thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
if ($columns == "2") {
$thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image-twocol');
} else {
$thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
}
$thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
$thumb_link_url = 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 = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
$thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
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 = get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
$permalink = get_permalink();
$custom_excerpt = 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);
}
$post_terms = get_the_terms($post->ID, 'portfolio-category');
$term_slug = " ";
if (!empty($post_terms)) {
foreach ($post_terms as $post_term) {
$term_slug = $term_slug . $post_term->slug . ' ';
}
}
/* COLUMN VARIABLE CONFIG
================================================== */
$item_class = $item_icon = "";
if ($columns == "2") {
//.........这里部分代码省略.........
示例5: sf_get_recent_post_item
function sf_get_recent_post_item($post, $display_type = "bold", $excerpt_length = 20, $item_class = "")
{
$recent_post = $recent_post_figure = $link_config = $item_icon = "";
$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');
}
// POST META
global $sf_options;
$single_author = $sf_options['single_author'];
$remove_dates = $sf_options['remove_dates'];
$post_links_match_thumb = false;
if (isset($sf_options['post_links_match_thumb'])) {
$post_links_match_thumb = $sf_options['post_links_match_thumb'];
}
$post_author = get_the_author_link();
$post_date = get_the_date();
$post_date_str = get_the_date('Y-m-d');
$item_title = get_the_title();
$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);
}
$post_permalink_config = 'href="' . $post_permalink . '" class="link-to-post"';
if ($post_links_match_thumb) {
$link_config = sf_post_item_link();
$post_permalink_config = $link_config['config'];
}
$thumb_width = apply_filters('sf_recent_post_item_thumb_width', 360);
$thumb_height = apply_filters('sf_recent_post_item_thumb_height', 270);
if ($display_type == "standard-row") {
$thumb_width = apply_filters('sf_recent_post_item_thumb_width', 400);
$thumb_height = apply_filters('sf_recent_post_item_thumb_height', 300);
}
// MEDIA CONFIG
$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 = apply_filters('sf_post_link_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 = apply_filters('sf_post_link_icon', "ss-link");
} else {
if ($thumb_link_type == "lightbox_thumb") {
$lightbox_id = rand();
if ($thumb_img_url != "") {
$link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $lightbox_id . ']"';
}
$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', '');
//.........这里部分代码省略.........
示例6: sf_get_post_item
function sf_get_post_item($postID, $blog_type, $show_title = "yes", $show_excerpt = "yes", $show_details = "yes", $excerpt_length = "20", $content_output = "excerpt", $show_read_more = "no")
{
$post_item = $thumb_img_url = $image_id = "";
$options = get_option('sf_dante_options');
$single_author = $options['single_author'];
$remove_dates = false;
if (isset($options['remove_dates']) && $options['remove_dates'] == 1) {
$remove_dates = true;
}
global $post, $sf_sidebar_config;
$post_format = get_post_format($postID);
if ($post_format == "") {
$post_format = 'standard';
}
$post_title = get_the_title();
$post_author = get_the_author_link();
$post_date = get_the_date();
$post_categories = get_the_category_list(', ');
$post_comments = get_comments_number();
$post_permalink = get_permalink();
$custom_excerpt = sf_get_post_meta($postID, 'sf_custom_excerpt', true);
$post_excerpt = '';
if ($content_output == "excerpt") {
if ($custom_excerpt != '') {
$post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
} else {
if ($post_format == "quote") {
$post_excerpt = sf_get_the_content_with_formatting();
} else {
$post_excerpt = sf_excerpt($excerpt_length);
}
}
} else {
$post_excerpt = sf_get_the_content_with_formatting();
}
if ($post_format == "chat") {
$post_excerpt = sf_content(40);
} else {
if ($post_format == "audio") {
$post_excerpt = do_shortcode(get_the_content());
} else {
if ($post_format == "video") {
$content = get_the_content();
$content = apply_filters('the_content', $content);
$post_excerpt = $content;
} else {
if ($post_format == "link") {
$content = get_the_content();
$content = apply_filters('the_content', $content);
$post_excerpt = $content;
}
}
}
}
$post_item = $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = $gallery_size = '';
if ($blog_type == "mini") {
if ($sf_sidebar_config == "no-sidebars") {
$thumb_width = 446;
$thumb_height = NULL;
$video_height = 335;
} else {
$thumb_width = 370;
$thumb_height = NULL;
$video_height = 260;
}
$gallery_size = 'thumb-image';
} else {
if ($blog_type == "masonry" || $blog_type == "masonry-fw") {
if ($sf_sidebar_config == "both-sidebars" || $blog_type == "masonry-fw") {
$item_class = "col-sm-3";
} else {
$item_class = "col-sm-4";
}
$thumb_width = 480;
$thumb_height = NULL;
$video_height = 360;
$gallery_size = 'thumb-image';
} else {
$thumb_width = 970;
$thumb_height = NULL;
$video_height = 728;
$gallery_size = 'blog-image';
}
}
$thumb_type = sf_get_post_meta($postID, 'sf_thumbnail_type', true);
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
$thumb_video = sf_get_post_meta($postID, 'sf_thumbnail_video_url', true);
$thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=' . $gallery_size);
$thumb_link_type = sf_get_post_meta($postID, 'sf_thumbnail_link_type', true);
$thumb_link_url = sf_get_post_meta($postID, '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($postID, 'sf_thumbnail_link_video_url', true);
$thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
$image_id = 0;
foreach ($thumb_image as $detail_image) {
$image_id = $detail_image['ID'];
$thumb_img_url = $detail_image['url'];
break;
}
//.........这里部分代码省略.........
示例7: sf_portfolio_item_link
function sf_portfolio_item_link()
{
$link_config = $item_icon = $thumb_img_url = "";
global $post, $sf_options;
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
$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);
$permalink = get_permalink();
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');
}
if ($thumb_link_type == "link_to_url") {
$link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
$item_icon = apply_filters('sf_port_url_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 = apply_filters('sf_port_url_icon', "ss-link");
} else {
if ($thumb_link_type == "lightbox_thumb") {
$link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[portfolio]"';
$item_icon = apply_filters('sf_port_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'];
}
$link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[portfolio]"';
$item_icon = apply_filters('sf_port_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_port_video_icon', "ss-video");
} else {
$link_config = 'href="' . $permalink . '" class="link-to-post"';
$item_icon = apply_filters('sf_port_post_icon', "ss-navigateright");
}
}
}
}
}
$item_link = array("icon" => $item_icon, "config" => $link_config);
return $item_link;
}
示例8: content
protected function content($atts, $content = null)
{
$title = $category = $item_class = $width = $el_class = $output = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', "item_count" => '5', "category" => 'all', 'alt_background' => 'none', '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;
$portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
$portfolio_items = new WP_Query($portfolio_args);
$items .= '<div class="portfolio-showcase-wrap"><ul class="portfolio-showcase-items clearfix" data-columns="' . $item_count . '">';
while ($portfolio_items->have_posts()) {
$portfolio_items->the_post();
$thumb_img_url = "";
$item_title = get_the_title();
$item_subtitle = get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
$thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
$thumb_link_url = 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 = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
$thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
foreach ($thumb_image as $detail_image) {
$thumb_img_url = $detail_image['url'];
break;
}
if (!$thumb_image || $thumb_img_url == "") {
$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();
$permalink = get_permalink();
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="' . $permalink . '" class="link-to-post"';
$item_icon = "ss-navigateright";
}
}
}
}
}
$items .= '<li itemscope class="clearfix portfolio-item deselected-item ' . $item_class . '">';
// THUMBNAIL MEDIA TYPE SETUP
$image_width = 700;
$image_height = 350;
if ($item_count == "5") {
$image_width = 500;
$image_height = 500;
}
if ($thumb_img_url == "") {
$thumb_img_url = "default";
}
$image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false);
if ($image) {
$items .= '<a ' . $link_config . '>';
$items .= '<img itemprop="image" class="main-image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
$items .= '</a>';
}
if ($item_subtitle == "") {
$items .= '<div class="item-info">';
$items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
$items .= '</div>';
} else {
$items .= '<div class="item-info has-subtitle">';
$items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
$items .= '<span><a href="' . $permalink . '">' . $item_subtitle . '</a></span>';
$items .= '</div>';
}
$items .= '</li>';
}
wp_reset_query();
//.........这里部分代码省略.........
示例9: content
protected function content($atts, $content = null)
{
$title = $category = $item_class = $width = $hover_style = $gutters = $fullwidth = $list_class = $el_class = $output = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', "item_count" => '12', 'item_columns' => '4', 'fullwidth' => 'no', 'gutters' => 'yes', "category" => 'all', 'hover_style' => 'default', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
/* SIDEBAR CONFIG
================================================== */
global $sf_sidebar_config, $sf_options;
$sidebars = '';
if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sf_sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
if (is_singular('portfolio')) {
$sidebars = "no-sidebars";
}
// 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++;
}
$portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
$portfolio_items = new WP_Query($portfolio_args);
$count = 0;
$figure_width = 300;
$figure_height = 225;
if ($item_columns == "3") {
$figure_width = 400;
$figure_height = 300;
}
if ($item_columns == "2") {
$figure_width = 600;
$figure_height = 450;
}
// Thumb Type
if ($hover_style == "default" && function_exists('sf_get_thumb_type')) {
$list_class = sf_get_thumb_type();
} else {
$list_class = 'thumbnail-' . $hover_style;
}
if ($gutters == "no") {
$list_class .= ' no-gutters';
} else {
$list_class .= ' gutters';
}
$items .= '<div id="carousel-' . $sf_carouselID . '" class="portfolio-items carousel-items clearfix ' . $list_class . '" data-columns="' . $item_columns . '" data-auto="false">';
while ($portfolio_items->have_posts()) {
$portfolio_items->the_post();
$port_hover_style = $port_hover_text_style = '';
$item_title = get_the_title();
$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');
$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 . ';"';
//.........这里部分代码省略.........