本文整理汇总了PHP中woo_embed函数的典型用法代码示例。如果您正苦于以下问题:PHP woo_embed函数的具体用法?PHP woo_embed怎么用?PHP woo_embed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woo_embed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: the_title
<h1><?php
the_title();
?>
</h1>
<span class="post-category"><?php
the_category(', ');
?>
</span>
</header>
<?php
echo woo_embed('width=580');
?>
<?php
if ($settings['thumb_single'] == 'true' && !woo_embed('') && '' != $image_src) {
?>
<img src="<?php
echo $image_src;
?>
" alt="" class="feature-thumb <?php
echo $settings['thumb_single_align'];
?>
" /><?php
}
?>
<section class="entry">
<?php
the_content();
?>
示例2: the_title_attribute
if (isset($slide_url) && $slide_url != '') {
?>
<a href="<?php
echo $slide_url;
?>
" title="<?php
the_title_attribute();
?>
">
<?php
}
// End If Statement
?>
<div class="slide-img">
<?php
$has_embed = woo_embed('width=864&key=embed&class=slide-video&id=' . $post->ID);
if ($has_embed) {
echo $has_embed;
// Minus 6px off the width to cater for the 3px border.
} else {
woo_image('key=image&width=864&h=&class=slide-image&link=img');
}
?>
</div>
<?php
if (isset($slide_url) && $slide_url != '') {
?>
</a>
<?php
}
// End If Statement
示例3: woo_portfolio_item_settings
function woo_portfolio_item_settings($id)
{
global $woo_options;
// Sanity check.
if (!is_numeric($id)) {
return;
}
$website_layout = 'two-col-left';
$website_width = '960px';
if (isset($woo_options['woo_layout'])) {
$website_layout = $woo_options['woo_layout'];
}
if (isset($woo_options['woo_layout_width'])) {
$website_width = $woo_options['woo_layout_width'];
}
$dimensions = woo_portfolio_image_dimensions($website_layout, $website_width);
$width = $dimensions['width'];
$height = $dimensions['height'];
$enable_gallery = false;
if (isset($woo_options['woo_portfolio_gallery'])) {
$enable_gallery = $woo_options['woo_portfolio_gallery'];
}
$settings = array('large' => '', 'caption' => '', 'rel' => '', 'gallery' => array(), 'css_classes' => 'group post portfolio-img', 'embed' => '', 'enable_gallery' => $enable_gallery, 'testimonial' => '', 'testimonial_author' => '', 'display_url' => '', 'width' => $width, 'height' => $height);
$meta = get_post_custom($id);
// Check if there is a gallery in post.
// woo_get_post_images is offset by 1 by default. Setting to offset by 0 to show all images.
$large = '';
if (isset($meta['portfolio-image'][0])) {
$large = $meta['portfolio-image'][0];
}
$caption = '';
if ($settings['enable_gallery'] == 'true') {
$gallery = woo_get_post_images('0');
if ($gallery) {
// Get first uploaded image in gallery
$large = $gallery[0]['url'];
$caption = $gallery[0]['caption'];
}
}
// End IF Statement
// If we only have one image, disable the gallery functionality.
if (is_array($gallery) && count($gallery) <= 1) {
$settings['enable_gallery'] = 'false';
}
// Check for a post thumbnail, if support for it is enabled.
if ($woo_options['woo_post_image_support'] == 'true' && current_theme_supports('post-thumbnails')) {
$image_id = get_post_thumbnail_id($id);
if (intval($image_id) > 0) {
$large_data = wp_get_attachment_image_src($image_id, 'large');
if (is_array($large_data)) {
$large = $large_data[0];
}
}
}
// See if lightbox-url custom field has a value
if (isset($meta['lightbox-url']) && $meta['lightbox-url'][0] != '') {
$large = $meta['lightbox-url'][0];
}
// Set rel on anchor to show lightbox
if (is_array($gallery) && count($gallery) <= 1) {
$rel = 'rel="lightbox"';
} else {
$rel = 'rel="lightbox[' . $id . ']"';
}
// Create CSS classes string.
$css = '';
$galleries = array();
$terms = get_the_terms($id, 'portfolio-gallery');
if (is_array($terms) && count($terms) > 0) {
foreach ($terms as $t) {
$galleries[] = $t->slug;
}
}
$css = join(' ', $galleries);
// If on the single item screen, check for a video.
if (is_singular()) {
$settings['embed'] = woo_embed('width=540');
}
// Add testimonial information.
if (isset($meta['testimonial']) && $meta['testimonial'][0] != '') {
$settings['testimonial'] = $meta['testimonial'][0];
}
if (isset($meta['testimonial_author']) && $meta['testimonial_author'][0] != '') {
$settings['testimonial_author'] = $meta['testimonial_author'][0];
}
// Look for a custom display URL of the portfolio item (used if it's a website, for example)
if (isset($meta['url']) && $meta['url'][0] != '') {
$settings['display_url'] = $meta['url'][0];
}
// Assign the values we have to our array.
$settings['large'] = $large;
$settings['caption'] = $caption;
$settings['rel'] = $rel;
$settings['gallery'] = $gallery;
$settings['css_classes'] .= ' ' . $css;
// Disable "enable_gallery" option is gallery is empty.
if (!is_array($settings['gallery']) || $settings['gallery'] == '' || count($settings['gallery']) <= 0) {
$settings['enable_gallery'] = 'false';
}
// Allow child themes/plugins to filter these settings.
//.........这里部分代码省略.........
示例4: locate_template
if ($gallery) {
// include('includes/gallery.php'); // Photo gallery
$tpl_gallery = '';
$tpl_gallery = locate_template(array('includes/gallery.php'));
if ($tpl_gallery) {
include $tpl_gallery;
}
// End IF Statement
} else {
woo_image('key=portfolio-image&width=534&class=portfolio-img');
}
?>
</div>
<?php
} elseif (!woo_embed('')) {
?>
<!-- End If portfolio_gallery -->
<div id="gallery">
<div class="entry">
<?php
woo_image('key=portfolio-image&width=534&class=portfolio-img');
?>
</div>
</div>
<?php
}
?>
<?php
示例5: while
<?php
if (have_posts()) {
$count = 0;
while (have_posts()) {
the_post();
$count++;
?>
<div class="single-portfolio-gallery fix">
<?php
$width = 864;
$args = 'width=' . $width;
$embed = woo_embed($args);
if ($embed != '') {
echo $embed;
} else {
$args .= '&return=true&link=img&noheight=true';
$html = '';
$rel = 'lightbox';
// Get the other images.
$images = woo_get_post_images(0, 'full');
if (count($images) > 0) {
$rel = 'lightbox[' . $post->ID . ']';
}
// Store featured image ID for exclusion
if (isset($woo_options['woo_post_image_support']) && $woo_options['woo_post_image_support'] == 'true' && current_theme_supports('post-thumbnails') && function_exists('get_post_thumbnail_id')) {
$featured_image_id = get_post_thumbnail_id($post->ID);
} else {
示例6: the_post_thumbnail
?>
" rel="nofollow"><?php
the_post_thumbnail('loop');
?>
</a>
</figure>
<figure class="video column-8">
<?php
$has_embed = false;
$custom_meta = get_post_custom($post->ID);
if (isset($custom_meta['embed']) && $custom_meta['embed'][0] != '') {
$has_embed = true;
}
if ($has_embed == true) {
echo woo_embed('key=embed&width=642&class=video-embed');
}
?>
</figure>
<?php
} else {
// ANY OTHER POST THUMBNAIL
?>
<figure class="column-8">
<a href="<?php
the_permalink();
?>
" rel="nofollow"><?php
the_post_thumbnail('type-photo');
示例7: woo_tumblog_video_content
function woo_tumblog_video_content($post_id)
{
$content_tumblog = '<div class="video-wrap">' . woo_embed('key=video-embed&width=' . get_option('woo_tumblog_video_width')) . '</div>';
return $content_tumblog;
}
示例8: woo_display_post_image
function woo_display_post_image()
{
global $woo_options;
$display_image = false;
$width = $woo_options['woo_thumb_w'];
$height = $woo_options['woo_thumb_h'];
$align = $woo_options['woo_thumb_align'];
if (is_single() && isset($woo_options['woo_thumb_single']) && $woo_options['woo_thumb_single'] == 'true') {
$width = $woo_options['woo_single_w'];
$height = $woo_options['woo_single_h'];
$align = $woo_options['woo_thumb_align_single'];
$display_image = true;
}
if (get_option('woo_woo_tumblog_switch') == 'true') {
$is_tumblog = woo_tumblog_test();
} else {
$is_tumblog = false;
}
if ($is_tumblog || is_single() && @$woo_options['woo_thumb_single'] == 'false') {
$display_image = false;
}
if ($display_image == true && !woo_embed('')) {
woo_image('width=' . $width . '&height=' . $height . '&class=thumbnail ' . $align);
}
}
示例9: the_title
>
<header>
<h1><?php
the_title();
?>
</h1>
<?php
brave_blank_post_meta();
?>
</header>
<div class="fix"></div>
<?php
echo woo_embed('width=' . $embed_width);
?>
<?php
if ($settings['thumb_single'] == 'true') {
$image = woo_image('return=true&width=' . $settings['single_w'] . '&height=' . $settings['single_h'] . '&link=img&class=thumbnail');
if ($image != '') {
?>
<?php
if (isset($woo_options['woo_post_content']) && $woo_options['woo_post_content'] != 'content') {
?>
<div class="drop-shadow curved curved-hz-1 <?php
echo $settings['thumb_single_align'];
?>
">
<a title="<?php
the_title_attribute();
示例10: get_post_meta
echo get_post_meta($post->ID, "slide_url", $single = true);
?>
"><img src="<?php
echo get_post_meta($post->ID, "slide_image", $single = true);
?>
" alt="" style="margin-bottom:<?php
echo $woo_options['woo_featured_image_margin'];
?>
px;" /></a>
</div>
<?php
} elseif (get_post_meta($post->ID, 'slide_embed', true)) {
?>
<?php
echo woo_embed('key=slide_embed&width=460&height=320&class=video');
?>
<?php
}
?>
<div class="wrap">
<?php
the_content();
?>
</div>
</div><!-- /.slide -->
<?php
}
}
示例11: woo_portfolio_image_dimensions
// Determine whether to display the embed code, if one exists, in place of the post gallery/image.
$dimensions = woo_portfolio_image_dimensions($woo_options['woo_layout'], $woo_options['woo_layout_width']);
$settings['width'] = $dimensions['width'];
$settings['height'] = $dimensions['height'];
$settings['thumb_width'] = $dimensions['thumb_width'];
$settings['thumb_height'] = $dimensions['thumb_height'];
if ($settings['height'] > 0) {
$settings['use_height'] = true;
}
if ($post_settings['embed'] != '') {
$settings['use_embed'] = true;
}
$embed_args = 'width=' . ($settings['width'] - 6);
// Cater for the 3px border.
// Look for a video embed code.
$embed = woo_embed($embed_args);
if ($embed != '' && $settings['use_embed'] == true) {
$settings['width'] = $settings['width'] - 6;
// Cater for the 3px border.
$settings['embed'] = $embed;
$container_class = 'video_container';
// Change the container class to be specific to videos.
}
// Allow child themes and plugins to filter these settings on a per-post basis.
$settings = apply_filters('woo_post_gallery_settings', $settings, $settings['post_id']);
/*-----------------------------------------------------------------------------------*/
/* Process code - Setup the query arguments and get the attachmented images. */
/*-----------------------------------------------------------------------------------*/
$images = array();
// Default value, to prevent images from displaying if we have an embedded video.
if ($settings['embed'] != '' && $settings['use_embed'] == true) {
示例12: woo_image
</div><!--/.entry-->
<?php
}
// Check for a slide image.
if ($post->has_image) {
?>
<div class="slide-image fl">
<?php
echo $anchor_start . woo_image($image_args) . $anchor_end;
?>
</div><!--/.slide-image-->
<?php
}
// Check for a video and no image.
if ($post->has_video && !$post->has_image) {
echo woo_embed('width=500');
}
?>
<div class="fix"></div><!--/.fix-->
</div><!--/.slide-->
<?php
}
?>
</div><!--/.slides_container .col-full-->
</div><!--/#slide-box-->
</div><!--/#slides-->
<?php
}
// End IF Statement
/* Reset the query. */
nxt_reset_query();
示例13: woo_embed
<p><?php
echo $content;
?>
</p><?php
}
?>
<a class="slide-overlay-toggle">#</a>
</div>
<?php
}
?>
<div class="image">
<?php
echo woo_embed('key=embed&width=760');
?>
</div>
</div>
<?php
} else {
?>
<div class="slide <?php
if ($featposts == 1) {
echo 'single-slide';
}
?>
">
示例14: woo_image
"><?php
woo_image('key=image&width=920&height=338&class=slide-img&link=img');
?>
</a>
<?php
} else {
?>
<?php
woo_image('key=image&width=920&height=338&class=slide-img&link=img');
}
?>
</div><!-- /.slide-image -->
<?php
} elseif ($has_video) {
echo woo_embed('key=embed&width=500&class=video');
}
?>
<div class="fix"></div>
<?php
} else {
?>
<!-- // End $type IF Statement -->
<div class="entry">
<?php
the_content();
?>
</div>
示例15: widget
function widget($args, $instance)
{
extract($args);
$title = $instance['title'];
$limit = $instance['limit'];
$cat_id = $instance['cat_id'];
$tag = $instance['tag'];
$width = 100;
if (!empty($tag)) {
$myposts = get_posts("numberposts={$limit}&tag={$tag}");
} else {
$myposts = get_posts("numberposts={$limit}&cat={$cat_id}");
}
$post_list = '';
$count = 0;
$active = "active";
$display = "";
echo $before_widget;
?>
<?php
echo $before_title . $title . $after_title;
?>
<?php
// Add actions for plugins/themes to hook onto.
do_action('widget_woo_embed_top');
if (isset($myposts)) {
foreach ($myposts as $mypost) {
$embed = woo_embed('width=' . $width . '&key=embed&class=widget_video&id=' . $mypost->ID);
if ($embed) {
$count++;
if ($count > 1) {
$active = '';
$display = "style='display:none'";
}
?>
<div class="widget-video-unit" <?php
echo $display;
?>
>
<?php
echo '<h4>' . get_the_title($mypost->ID) . "</h4>\n";
echo $embed;
$post_list .= "<li class='{$active}'><a href='#'>" . get_the_title($mypost->ID) . "</a></li>\n";
?>
</div>
<?php
}
}
}
?>
<ul class="widget-video-list">
<?php
echo $post_list;
?>
</ul>
<?php
// Add actions for plugins/themes to hook onto.
do_action('widget_woo_embed_bottom');
echo $after_widget;
}