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


PHP nectar_video函数代码示例

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


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

示例1: get_permalink

        echo '<a href="' . get_permalink() . '"><span class="post-featured-img"><img src="' . get_template_directory_uri() . '/img/' . $no_image_size . '" alt="no image added yet." /></span></a>';
    }
} else {
    $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
    $video_m4v = get_post_meta($post->ID, '_nectar_video_m4v', true);
    $video_ogv = get_post_meta($post->ID, '_nectar_video_ogv', true);
    $video_poster = get_post_meta($post->ID, '_nectar_video_poster', true);
    if (!empty($video_embed) || !empty($video_m4v)) {
        $wp_version = floatval(get_bloginfo('version'));
        //video embed
        if (!empty($video_embed)) {
            echo '<div class="video">' . do_shortcode($video_embed) . '</div>';
        } else {
            if (!empty($video_m4v) && $wp_version < "3.6") {
                echo '<div class="video">';
                nectar_video($post->ID);
                echo '</div>';
            } else {
                if ($wp_version >= "3.6") {
                    if (!empty($video_m4v) || !empty($video_ogv)) {
                        $video_output = '[video ';
                        if (!empty($video_m4v)) {
                            $video_output .= 'mp4="' . $video_m4v . '" ';
                        }
                        if (!empty($video_ogv)) {
                            $video_output .= 'ogv="' . $video_ogv . '"';
                        }
                        $video_output .= ' poster="' . $video_poster . '"]';
                        echo '<div class="video">' . do_shortcode($video_output) . '</div>';
                    }
                }
开发者ID:kslarson1,项目名称:pignwhistle,代码行数:31,代码来源:entry-video.php

示例2: nectar_recent_posts

function nectar_recent_posts($atts, $content = null)
{
    extract(shortcode_atts(array("title_labels" => 'false', 'category' => 'all', 'posts_per_page' => '4', 'columns' => '4'), $atts));
    global $post;
    global $options;
    $posts_page_id = get_option('page_for_posts');
    $posts_page = get_page($posts_page_id);
    $posts_page_title = $posts_page->post_title;
    $posts_page_link = get_page_uri($posts_page_id);
    $title_label_output = null;
    $recent_posts_title_text = !empty($options['recent-posts-title']) ? $options['recent-posts-title'] : 'Recent Posts';
    $recent_posts_link_text = !empty($options['recent-posts-link']) ? $options['recent-posts-link'] : 'View All Posts';
    //incase only all was selected
    if ($category == 'all') {
        $category = null;
    }
    $title_labels == 'true' ? $title_label_output = '<h2 class="uppercase recent-posts-title">' . $recent_posts_title_text . '<a href="' . $posts_page_link . '" class="button"> / ' . $recent_posts_link_text . '</a></h2>' : ($title_label_output = null);
    ob_start();
    echo $title_label_output;
    ?>
		
		<div class="row blog-recent columns-<?php 
    echo $columns;
    ?>
">
			
			<?php 
    $recentBlogPosts = array('showposts' => $posts_per_page, 'category_name' => $category, 'ignore_sticky_posts' => 1, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-link', 'post-format-quote'), 'operator' => 'NOT IN')));
    $recent_posts_query = new WP_Query($recentBlogPosts);
    if ($recent_posts_query->have_posts()) {
        while ($recent_posts_query->have_posts()) {
            $recent_posts_query->the_post();
            if ($columns == '4') {
                $col_num = 'span_3';
            } else {
                if ($columns == '3') {
                    $col_num = 'span_4';
                } else {
                    if ($columns == '2') {
                        $col_num = 'span_6';
                    } else {
                        $col_num = 'span_12';
                    }
                }
            }
            ?>

			<div class="col <?php 
            echo $col_num;
            ?>
">
				
				<?php 
            $wp_version = floatval(get_bloginfo('version'));
            if (get_post_format() == 'video') {
                if ($wp_version < "3.6") {
                    $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
                    if (!empty($video_embed)) {
                        echo '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                    } else {
                        nectar_video($post->ID);
                    }
                } else {
                    $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
                    $video_m4v = get_post_meta($post->ID, '_nectar_video_m4v', true);
                    $video_ogv = get_post_meta($post->ID, '_nectar_video_ogv', true);
                    $video_poster = get_post_meta($post->ID, '_nectar_video_poster', true);
                    if (!empty($video_embed) || !empty($video_m4v)) {
                        $wp_version = floatval(get_bloginfo('version'));
                        //video embed
                        if (!empty($video_embed)) {
                            echo '<div class="video">' . do_shortcode($video_embed) . '</div>';
                        } else {
                            if (!empty($video_m4v) && $wp_version < "3.6") {
                                echo '<div class="video">';
                                nectar_video($post->ID);
                                echo '</div>';
                            } else {
                                if ($wp_version >= "3.6") {
                                    if (!empty($video_m4v) || !empty($video_ogv)) {
                                        $video_output = '[video ';
                                        if (!empty($video_m4v)) {
                                            $video_output .= 'mp4="' . $video_m4v . '" ';
                                        }
                                        if (!empty($video_ogv)) {
                                            $video_output .= 'ogv="' . $video_ogv . '"';
                                        }
                                        $video_output .= ' poster="' . $video_poster . '"]';
                                        echo '<div class="video">' . do_shortcode($video_output) . '</div>';
                                    }
                                }
                            }
                        }
                    }
                    // endif for if there's a video
                }
                // endif for 3.6
            } else {
                if (get_post_format() == 'audio') {
                    ?>
//.........这里部分代码省略.........
开发者ID:nignjatov,项目名称:TaxiDev,代码行数:101,代码来源:shortcode-processing.php

示例3: and

			display: none!important;
		}
		.wp-video { width: 100%!important; }
		@media only screen 
		and (min-width : 1px) and (max-width : 1050px) {
			body {background-color: transparent!important;}
		}
	</style>
<?php 
}
?>

<body class="pp-video-function">
<?php 
if (floatval(get_bloginfo('version')) < "3.6") {
    nectar_video($postid);
} else {
    //self hosted
    if (!empty($video_m4v) || !empty($video_ogv)) {
        $video_output = '[video ';
        if (!empty($video_m4v)) {
            $video_output .= 'mp4="' . $video_m4v . '" ';
        }
        if (!empty($video_ogv)) {
            $video_output .= 'ogv="' . $video_ogv . '"';
        }
        $video_output .= ' poster="' . $video_poster . '"]';
        echo '<div class="video">' . do_shortcode($video_output) . '</div>';
    } else {
        echo '<div id="pp-video-wrap">' . do_shortcode($video) . '</div>';
    }
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:31,代码来源:video.php

示例4: nectar_recent_posts

function nectar_recent_posts($atts, $content = null)
{
    extract(shortcode_atts(array("title_labels" => 'false', 'category' => 'all', 'slider_size' => '600', 'slider_above_text' => '', 'posts_per_page' => '4', 'columns' => '4', 'style' => 'default', 'post_offset' => '0'), $atts));
    global $post;
    global $options;
    $posts_page_id = get_option('page_for_posts');
    $posts_page = get_page($posts_page_id);
    $posts_page_title = $posts_page->post_title;
    $posts_page_link = get_page_uri($posts_page_id);
    $title_label_output = null;
    $recent_posts_title_text = !empty($options['recent-posts-title']) ? $options['recent-posts-title'] : 'Recent Posts';
    $recent_posts_link_text = !empty($options['recent-posts-link']) ? $options['recent-posts-link'] : 'View All Posts';
    //incase only all was selected
    if ($category == 'all') {
        $category = null;
    }
    if ($style != 'slider') {
        $title_labels == 'true' ? $title_label_output = '<h2 class="uppercase recent-posts-title">' . $recent_posts_title_text . '<a href="' . $posts_page_link . '" class="button"> / ' . $recent_posts_link_text . '</a></h2>' : ($title_label_output = null);
        ob_start();
        echo $title_label_output;
        ?>
			
			<div class="row blog-recent columns-<?php 
        echo $columns;
        ?>
" data-style="<?php 
        echo $style;
        ?>
">
				
				<?php 
        $recentBlogPosts = array('showposts' => $posts_per_page, 'category_name' => $category, 'ignore_sticky_posts' => 1, 'offset' => $post_offset, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-link', 'post-format-quote'), 'operator' => 'NOT IN')));
        $recent_posts_query = new WP_Query($recentBlogPosts);
        if ($recent_posts_query->have_posts()) {
            while ($recent_posts_query->have_posts()) {
                $recent_posts_query->the_post();
                if ($columns == '4') {
                    $col_num = 'span_3';
                } else {
                    if ($columns == '3') {
                        $col_num = 'span_4';
                    } else {
                        if ($columns == '2') {
                            $col_num = 'span_6';
                        } else {
                            $col_num = 'span_12';
                        }
                    }
                }
                ?>

				<div class="col <?php 
                echo $col_num;
                ?>
">
					
					<?php 
                $wp_version = floatval(get_bloginfo('version'));
                if ($style == 'default') {
                    if (get_post_format() == 'video') {
                        if ($wp_version < "3.6") {
                            $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
                            if (!empty($video_embed)) {
                                echo '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                            } else {
                                nectar_video($post->ID);
                            }
                        } else {
                            $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
                            $video_m4v = get_post_meta($post->ID, '_nectar_video_m4v', true);
                            $video_ogv = get_post_meta($post->ID, '_nectar_video_ogv', true);
                            $video_poster = get_post_meta($post->ID, '_nectar_video_poster', true);
                            if (!empty($video_embed) || !empty($video_m4v)) {
                                $wp_version = floatval(get_bloginfo('version'));
                                //video embed
                                if (!empty($video_embed)) {
                                    echo '<div class="video">' . do_shortcode($video_embed) . '</div>';
                                } else {
                                    if (!empty($video_m4v) && $wp_version < "3.6") {
                                        echo '<div class="video">';
                                        nectar_video($post->ID);
                                        echo '</div>';
                                    } else {
                                        if ($wp_version >= "3.6") {
                                            if (!empty($video_m4v) || !empty($video_ogv)) {
                                                $video_output = '[video ';
                                                if (!empty($video_m4v)) {
                                                    $video_output .= 'mp4="' . $video_m4v . '" ';
                                                }
                                                if (!empty($video_ogv)) {
                                                    $video_output .= 'ogv="' . $video_ogv . '"';
                                                }
                                                $video_output .= ' poster="' . $video_poster . '"]';
                                                echo '<div class="video">' . do_shortcode($video_output) . '</div>';
                                            }
                                        }
                                    }
                                }
                            }
                            // endif for if there's a video
//.........这里部分代码省略.........
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:101,代码来源:shortcode-processing.php


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