本文整理汇总了PHP中MultiPostThumbnails::get_post_thumbnail_id方法的典型用法代码示例。如果您正苦于以下问题:PHP MultiPostThumbnails::get_post_thumbnail_id方法的具体用法?PHP MultiPostThumbnails::get_post_thumbnail_id怎么用?PHP MultiPostThumbnails::get_post_thumbnail_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiPostThumbnails
的用法示例。
在下文中一共展示了MultiPostThumbnails::get_post_thumbnail_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_image_directory
function custom_image_directory($path, $args)
{
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail('post', 'twitter-image', $args['id'])) {
// get the image for Twitter
$imgid = MultiPostThumbnails::get_post_thumbnail_id('post', 'twitter-image', $args['id']);
$path = wp_get_attachment_url($imgid);
// Using amazon S3? Replace your S3 path with local path
$path = str_replace('http://brewbound-images.s3.amazonaws.com/', 'c:\\inetpub\\wp-brewbound\\', $path);
$path = str_replace('/', '\\', $path);
}
return $path;
}
示例2: get_extra_images
function get_extra_images()
{
global $post, $wp_query;
$extra_images_no = get_option("extra_images_no");
$post_ID = $post->ID;
if ($extra_images_no == "") {
$extra_images_no = 4;
}
$postFormat = get_post_format($post->ID);
$page_template = get_page_template();
$path = pathinfo($page_template);
$page_template = $path['filename'];
$post_extra_images = array();
//$post_captions = array();
$post_type = get_post_type($post->ID);
for ($i = 1; $i <= $extra_images_no; $i++) {
if (get_post_meta($post_ID, "background_image", true) != "extra-image-" . $i) {
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail($post_type, "extra-image-" . $i . "")) {
$image_id = MultiPostThumbnails::get_post_thumbnail_id($post_type, "extra-image-" . $i . "", $post_ID);
$image_feature_url = wp_get_attachment_image_src($image_id, "thumbnail");
//$post_extra_images[] = $image_feature_url[0];
$post_extra_images .= '<img src="' . $image_feature_url[0] . '" alt="' . get_post_field('post_excerpt', $image_id) . '" />';
print '<img src="' . $image_feature_url[0] . '" alt="' . get_post_field('post_excerpt', $image_id) . '" />';
//$image_thumb_url = wp_get_attachment_image_src( $image_id, "thumbnail" );
//$post_extra_thumb_images[] = $image_thumb_url[0];
//$post_captions[$i-1] = get_post_field('post_excerpt', $image_id);
}
}
}
}
示例3: thumbnail_meta_box_modal
//.........这里部分代码省略.........
}
options = {
title: title,
library: {
type: 'image'
}
};
thumbnailId = $thumbnailId.val();
if ( '' !== thumbnailId && -1 !== thumbnailId )
options.selection = [ Attachment.get( thumbnailId ) ];
frame = wp.media( options );
frame.toolbar.on( 'activate:select', function() {
frame.toolbar.view().set({
select: {
style: 'primary',
text: update,
click: function() {
var selection = frame.state().get('selection'),
model = selection.first(),
sizes = model.get('sizes'),
size;
setMPTImage( model.id );
// @todo: might need a size hierarchy equivalent.
if ( sizes )
size = sizes['<?php
echo esc_js("{$this->post_type}-{$this->id}-thumbnail");
?>
'] || sizes['post-thumbnail'] || sizes.medium;
// @todo: Need a better way of accessing full size
// data besides just calling toJSON().
size = size || model.toJSON();
frame.close();
$( '<img />', {
src: size.url,
width: size.width
}).prependTo( $element );
}
}
});
});
});
$element.on( 'click', '.remove', function( event ) {
event.preventDefault();
setMPTImage( -1 );
});
});
</script>
<?php
$thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id($this->post_type, $this->id, $post->ID);
$thumbnail_size = isset($_wp_additional_image_sizes["{$this->prefix}-thumbnail"]) ? "{$this->prefix}-thumbnail" : 'medium';
$thumbnail_html = wp_get_attachment_image($thumbnail_id, $thumbnail_size);
$classes = empty($thumbnail_id) ? '' : 'has-featured-image';
?>
<div id="select-mpt-<?php
echo esc_attr($this->prefix);
?>
"
class="<?php
echo esc_attr($classes);
?>
"
data-post-id="<?php
echo esc_attr($post->ID);
?>
">
<?php
echo $thumbnail_html;
?>
<input type="hidden" name="<?php
echo esc_js($this->prefix);
?>
-thumbnail_id" value="<?php
echo esc_attr($thumbnail_id);
?>
" />
<a href="#" class="choose button-secondary">Choose a <?php
echo esc_html($this->label);
?>
</a>
<a href="#" class="remove">Remove <?php
echo esc_html($this->label);
?>
</a>
</div>
<?php
}
示例4: memberlite_getBannerImageID
function memberlite_getBannerImageID($post = NULL)
{
global $memberlite_defaults;
$memberlite_loop_images = get_theme_mod('memberlite_loop_images', $memberlite_defaults['memberlite_loop_images']);
if (in_the_loop() && ($memberlite_loop_images == 'show_both' || $memberlite_loop_images == 'show_banner') || is_single() || is_home() || is_page() && !is_page_template('templates/landing.php')) {
if (class_exists('MultiPostThumbnails')) {
//The Banner Image meta box is available
$thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id($post->post_type, 'memberlite_banner_image' . $post->post_type, $post->ID);
}
if (!empty($thumbnail_id)) {
//Use Banner Image as banner
return $thumbnail_id;
} else {
$memberlite_show_image_banner = get_post_meta($post->ID, 'memberlite_show_image_banner', true);
if (!empty($memberlite_show_image_banner) || in_the_loop()) {
//Use Featured Image as banner
$thumbnail_id = get_post_thumbnail_id($post->ID);
return $thumbnail_id;
} else {
return false;
}
}
} else {
return false;
}
}
示例5: get_header
<?php
/**
* The template for displaying all single posts and attachments
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
get_header();
the_post();
$slider = MultiPostThumbnails::get_post_thumbnail_id('pelicula', 'interior', $post->ID);
$slider = wp_get_attachment_image_src($slider, 'full');
$anio = get_post_meta($post->ID, "wpcf-ano-de-estreno", true);
$stars = get_post_meta($post->ID, "wpcf-calificacion", true);
?>
<section class="w-clearfix content">
<div class="moviecontent">
<div class="w-clearfix c960">
<div class="w-clearfix peliculasrecientes">
<h1 class="titlesection"><?php
the_title();
?>
</h1>
<div class="pordagrande" style="background-image: url('<?php
echo $slider[0];
?>
')"></div>
<div class="w-clearfix descripcionpeli">
<div class="w-clearfix des">
<h1 class="titlesection titleinfo">Resumen</h1>
示例6: get_header
*/
get_header();
?>
<?php
$pages = unserialize(get_option('parallax_page_list', true));
$p_count = count($pages);
if (is_array($pages) && !empty($pages)) {
foreach ($pages as $ids) {
$content_post = get_post($ids);
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
$color = get_post_meta($ids, 'pbgcolor', true);
$paraanimate = get_post_meta($ids, 'parallax_animate', true);
$paraoverlay = get_post_meta($ids, 'parallax_overlay', true);
$custom = MultiPostThumbnails::get_post_thumbnail_id('page', 'parallax-image', $ids);
$custom = wp_get_attachment_image_src($custom, 'parallax-image');
$url = $custom[0];
$back_status = get_post_meta($ids, 'backgroud_status', true);
$back = '';
if ($url != '') {
$back = $url;
} else {
$back = '';
}
$animate = '';
if ($paraanimate == 'yes') {
$animate = 'animation: animatedBackground 80s linear infinite;-ms-animation: animatedBackground 80s linear infinite;-moz-animation: animatedBackground 80s linear infinite;-webkit-animation: animatedBackground 80s linear infinite;background-attachment: fixed;';
}
$overlay = '';
if ($paraoverlay == 'yes') {
示例7: get_queried_object_id
?>
" />
<figcaption><?php
echo $caption;
?>
</figcaption>
</figure>
<?php
}
?>
<?php
if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'image3')) {
?>
<?php
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'image3', get_queried_object_id());
$post_thumbnail_post = get_post($post_thumbnail_id);
$caption = trim(strip_tags($post_thumbnail_post->post_excerpt));
$caption = esc_html($caption);
?>
<figure class="extra-image">
<img src="<?php
echo $imgURL = MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'image3', NULL, 'large');
?>
" alt="<?php
echo $caption;
?>
" />
<figcaption><?php
echo $caption;
?>
示例8: get_the_title
<?php
require_once '../../../../wp-config.php';
global $wpdb;
global $db;
$id = $_REQUEST['id'];
$fondo = MultiPostThumbnails::get_post_thumbnail_id('pelicula', 'descripcion', $id);
$fondo = wp_get_attachment_image_src($fondo, 'descripcion');
$anio = get_post_meta($id, "wpcf-ano-de-estreno", true);
$post = get_post($id);
$excerpt = get_the_excerpt($id);
$excerpt = substr($excerpt, 0, 220);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
?>
<div class="imagecontent" style="background-image: url('<?php
echo $fondo[0];
?>
')"></div>
<div class="shadow"></div>
<div class="w-clearfix textdescription">
<h1 class="titul tdescrip"><?php
echo get_the_title($id);
?>
</h1>
<div class="extract"><?php
echo $excerpt . '...';
?>
</div>
<div class="year">Año de estreno: <span class="yea"><?php
echo $anio;
示例9: ep_thumbnail_gallery_slideshow
function ep_thumbnail_gallery_slideshow($image_size, $id, $post_name, $terms, $isLink, $pLink)
{
// Add slideshow javascript
global $add_slider;
$add_slider = true;
$maxthumbnum = 3;
// Set the slideshow variable
$slideshow = '';
// Get The Post Type
$posttype = get_post_type($id);
// Check whether the slide should link
$permalink = get_permalink($id);
$title = get_the_title($id);
// get the item title
//For custom taxonomy use this line below
$terms = wp_get_object_terms($id, 'gallery_cat');
$term_names = array();
foreach ($terms as $term) {
$term_names[] = $term->name;
}
if ($isLink == true) {
$permalink = '<div class="galleryItem" data-sub-html=" <h4> ' . get_the_title($id) . '</h4><p>' . get_post_meta($id, "subtitle-text", true) . '</p>" data-src="' . $pLink . '"><a href="' . $pLink . '" title="' . $title . '" class="portfolioLink overlay thumbnail-' . $image_size . '">';
} else {
$gallery_url = '';
$gallery_url = get_post_meta($id, '_thumbnail_id', false);
$gallery_url = wp_get_attachment_image_src($gallery_url[0], $image_size, false);
$permalink = '<div class="galleryItem" data-sub-html=" <h4> ' . get_the_title($id) . '</h4><p>' . get_post_meta($id, "subtitle-text", true) . '</p>" data-src="' . $gallery_url[0] . '"><a href="' . $gallery_url[0] . '" title="' . $title . '" class=" portfolioLink overlay thumbnail-' . $image_size . '">';
}
$permalinkend = '</a></div>';
$counter = 2;
//start counter at 2
$full = get_post_meta($id, '_thumbnail_id', false);
// Get Image ID
$image_size = 'ep_thumbnail-' . $image_size;
// Get all slides
${"full" . $counter} = MultiPostThumbnails::get_post_thumbnail_id($posttype, $counter . '-slide', $id);
// Get Image ID
${"alt" . $counter} = get_post_meta(${"full" . $counter}, '_wp_attachment_image_alt', true);
// Alt text of image
${"full" . $counter} = wp_get_attachment_image_src(${"full" . $counter}, false);
// URL of Second Slide Full Image
${"thumb" . $counter} = MultiPostThumbnails::get_post_thumbnail_id($posttype, $counter . '-slide', $id);
${"thumb" . $counter} = wp_get_attachment_image_src(${"thumb" . $counter}, $image_size, false);
// URL of next Slide
//number of entered thumbnails
$maxthumbnumset = 1;
// Show featured image
$thumb = '';
if ($full) {
$alt = get_post_meta($full, '_wp_attachment_image_alt', true);
// Alt text of image
$thumb = get_post_meta($id, '_thumbnail_id', false);
$thumb = wp_get_attachment_image_src($thumb[0], $image_size, false);
// URL of Featured first slide
}
$slideshow .= $permalink . '<div class="hoverContent">';
$slideshow .= '<div class="frame top">';
$slideshow .= '<div></div>';
$slideshow .= '</div>';
$slideshow .= '<div class="frame right">';
$slideshow .= '<div></div>';
$slideshow .= '</div>';
$slideshow .= '<div class="frame bottom">';
$slideshow .= '<div></div>';
$slideshow .= '</div>';
$slideshow .= '<div class="frame left">';
$slideshow .= '<div></div>';
$slideshow .= '</div>';
$slideshow .= '<div class="icon-wrap"><div class="icon-type"></div></div><div class="center-line"></div><div class="title-wrap"><div class="titleContainer"><div class="hover-title" >' . get_the_title($id) . '</div><div class="hover-subtitle">' . implode(', ', $term_names) . '</div></div></div>';
$slideshow .= '</div>';
$slideshow .= $permalinkend;
$slideshow .= '<div class="like">' . getPostLikeLink($id) . '</div>';
$thumb1 = $thumb;
// Loop through thumbnails and set them
$tcounter = 1;
while ($tcounter <= $maxthumbnum) {
if (${'thumb' . $tcounter}) {
//If there is just 1 thumb or it is ipad
if ($maxthumbnumset == 1 || isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
$slideshow .= '<div class="pSlide" style="background-image: url(' . ${'thumb' . $tcounter}[0] . ');"><a href="' . ${'thumb' . $tcounter}[0] . '" ></a></div>';
break;
} else {
$slideshow .= '<div class="pSlide" style="background-image: url(' . ${'thumb' . $tcounter}[0] . ');"><a href="' . ${'thumb' . $tcounter}[0] . '"></a></div>';
}
}
$tcounter++;
}
return $slideshow;
}
示例10: get_post_thumbnail_id
if (has_post_thumbnail($section->ID)) {
$hasImage = true;
$thumbnail_id = get_post_thumbnail_id($section->ID);
$image = wp_get_attachment_url($thumbnail_id);
}
//get other feature images
if (class_exists('MultiPostThumbnails')) {
$i = 1;
$j = 1;
$imagefe = array();
$imagefe[0] = $image;
while ($i <= 9) {
$image_name = 'feature-image-' . $i;
// sets image name as feature-image-1, feature-image-2 etc.
if (MultiPostThumbnails::has_post_thumbnail('page_section', $image_name, $section->ID)) {
$image_id = MultiPostThumbnails::get_post_thumbnail_id('page_section', $image_name, $section->ID);
$imagefe[$j] = wp_get_attachment_url($image_id);
$j++;
}
$i++;
}
}
$format = get_post_meta($section->ID, 'section_format', true);
$format = esc_attr($format);
$theme = get_post_meta($section->ID, 'section_theme', true);
$theme = esc_attr($theme);
//1=>dark 2=>intense 3=>medium 4=>light
?>
<div class="pageSection theme<?php
echo $theme;
?>
示例11: bliccaThemes_gallery
function bliccaThemes_gallery($id)
{
$gallery_style = get_post_meta(get_the_ID(), 'gallery_format_style', true);
$gallery_class = $thumbsizer = "";
if ($gallery_style == "grid") {
$gallery_class = "post-grid-thumbnails";
$thumbsizer = "bliccaThemes-grid";
} else {
$gallery_class = "post-slider";
$thumbsizer = "post-thumbnails";
}
if (class_exists('MultiPostThumbnails')) {
?>
<div class="<?php
echo esc_attr($gallery_class);
?>
">
<ul class="slides">
<?php
if (has_post_thumbnail()) {
$post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
$thumb_post = get_post($post_thumbnail_id);
// ESC
//
$src_url = esc_url($thumb_post->guid);
$caption = trim(strip_tags($thumb_post->post_excerpt));
if (!empty($caption)) {
$caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
} else {
$caption = "";
}
echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . get_the_post_thumbnail($id, $thumbsizer) . '</a>' . $caption . '</li>';
}
?>
<?php
if (class_exists('MultiPostThumbnails')) {
$image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image', NULL, $thumbsizer);
}
if (!empty($image)) {
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'secondary-image', get_the_ID());
$thumb_post = get_post($post_thumbnail_id);
$src_url = esc_url($thumb_post->guid);
$caption = trim(strip_tags($thumb_post->post_excerpt));
if (!empty($caption)) {
$caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
} else {
$caption = "";
}
echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
}
if (class_exists('MultiPostThumbnails')) {
$image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'third-image', NULL, $thumbsizer);
}
if (!empty($image)) {
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'third-image', get_the_ID());
$thumb_post = get_post($post_thumbnail_id);
$src_url = esc_url($thumb_post->guid);
$caption = trim(strip_tags($thumb_post->post_excerpt));
if (!empty($caption)) {
$caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
} else {
$caption = "";
}
echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
}
if (class_exists('MultiPostThumbnails')) {
$image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fourth-image', NULL, $thumbsizer);
}
if (!empty($image)) {
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'fourth-image', get_the_ID());
$thumb_post = get_post($post_thumbnail_id);
$src_url = esc_url($thumb_post->guid);
$caption = trim(strip_tags($thumb_post->post_excerpt));
if (!empty($caption)) {
$caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
} else {
$caption = "";
}
echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
}
if (class_exists('MultiPostThumbnails')) {
$image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fifth-image', NULL, $thumbsizer);
}
if (!empty($image)) {
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'fifth-image', get_the_ID());
$thumb_post = get_post($post_thumbnail_id);
$src_url = esc_url($thumb_post->guid);
$caption = trim(strip_tags($thumb_post->post_excerpt));
if (!empty($caption)) {
$caption = '<div class="bliccaThemes-caption">' . esc_attr($caption) . '</div>';
} else {
$caption = "";
}
echo '<li><a href="' . $src_url . '" class="prettyPhoto" data-rel="prettyPhoto">' . $image . '</a>' . $caption . '</li>';
}
if (class_exists('MultiPostThumbnails')) {
$image = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'last-image', NULL, $thumbsizer);
}
if (!empty($image)) {
$post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'last-image', get_the_ID());
//.........这里部分代码省略.........
示例12: get_homepage_info
function get_homepage_info($image_size, $id, $crop, $thumbnum)
{
global $thumb, $full, $alt, $caption, $image_title;
$i = 2;
while ($i < $thumbnum) {
global ${"thumb" . $i};
global ${"caption" . $i};
global ${"full" . $i};
global ${"alt" . $i};
$i++;
}
$counter = 2;
//start counter at 2
$args = array('post_type' => 'attachment', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => null, 'post_parent' => $id);
$thumbnail_image = get_posts($args);
if ($thumbnail_image) {
$caption = $thumbnail_image[0]->post_excerpt;
}
$full = get_post_meta($id, '_thumbnail_id', false);
// Get Image ID
$alt = get_post_meta($full, '_wp_attachment_image_alt', true);
// Alt text of image
$full = wp_get_attachment_image_src($full[0], 'blog', false);
// URL of Featured Full Image
if ($crop) {
if ($crop == 'No Crop') {
$thumb = get_post_meta($id, '_thumbnail_id', false);
$thumb = wp_get_attachment_image_src($thumb[0], false);
// URL of Featured first slide
} else {
$thumb = get_post_meta($id, '_thumbnail_id', false);
$thumb = wp_get_attachment_image_src($thumb[0], $image_size, false);
// URL of Featured first slide
}
} else {
$thumb = get_post_meta($id, '_thumbnail_id', false);
$thumb = wp_get_attachment_image_src($thumb[0], $image_size, false);
// URL of Featured first slide
}
while ($counter < $thumbnum) {
if ($counter == 2) {
$countername = 'second';
} else {
if ($counter == 3) {
$countername = 'third';
} else {
if ($counter == 4) {
$countername = 'fourth';
} else {
if ($counter == 5) {
$countername = 'fifth';
} else {
if ($counter == 6) {
$countername = 'sixth';
} else {
$countername = $counter;
}
}
}
}
}
${"full" . $counter} = MultiPostThumbnails::get_post_thumbnail_id('post', $countername . '-slide', $id);
// Get Image ID
// The thumbnail caption:
${"caption" . $counter} = get_post(${"full" . $counter})->post_excerpt;
${"alt" . $counter} = get_post_meta(${"full" . $counter}, '_wp_attachment_image_alt', true);
// Alt text of image
${"full" . $counter} = wp_get_attachment_image_src(${"full" . $counter}, false);
// URL of Second Slide Full Image
if ($crop) {
if ($crop == 'No Crop') {
${"thumb" . $counter} = MultiPostThumbnails::get_post_thumbnail_id('post', $countername . '-slide', $id);
${"thumb" . $counter} = wp_get_attachment_image_src(${"thumb" . $counter}, false);
// URL of next Slide
} else {
${"thumb" . $counter} = MultiPostThumbnails::get_post_thumbnail_id('post', $countername . '-slide', $id);
${"thumb" . $counter} = wp_get_attachment_image_src(${"thumb" . $counter}, $image_size, false);
// URL of next Slide
}
} else {
${"thumb" . $counter} = MultiPostThumbnails::get_post_thumbnail_id('post', $countername . '-slide', $id);
${"thumb" . $counter} = wp_get_attachment_image_src(${"thumb" . $counter}, $image_size, false);
// URL of next Slide
}
$counter++;
}
}
示例13: marketify_get_attached_media_args
/**
*
*/
function marketify_get_attached_media_args($args, $type, $post)
{
global $post;
if ('image' != $type) {
return $args;
}
if ('download' != $post->post_type) {
return $args;
}
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::get_the_post_thumbnail('download', 'grid-image')) {
$args['exclude'] = MultiPostThumbnails::get_post_thumbnail_id('download', 'grid-image', $post->ID);
}
return $args;
}
示例14: team_list
function team_list($atts) {
global $meta_box;
$q = new WP_Query(array(
'post_type' => 'team',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1, // = all of 'em
));
echo '<div id="team-grid">';
echo '<div class="row">';
foreach ($q->posts as $item) {
$team_title = get_post_meta( $item->ID, 'team_title', true );
$photo = wp_get_attachment_image_src( get_post_thumbnail_id( $item->ID ), 'single-post-thumbnail' );
$thumb = wp_get_attachment_image_src( MultiPostThumbnails::get_post_thumbnail_id('team', 'secondary-image', $item->ID), 'single-post-thumbnail' );
list($width, $height) = getimagesize($_SERVER[DOCUMENT_ROOT].$thumb[0]);
//echo grid element
if ($width == 410) {
echo '<div class="span4">';
} else {
echo '<div class="span2">';
}
echo '<figure>';
echo '<a class="no-ajaxy" data-toggle="modal" href="#' . $item->post_name . '" >';
echo '<img src="'.$thumb[0].'" alt="' .$item->post_title. 's">';
echo '<figcaption>';
echo $item->post_title;
echo '<br>';
echo '<i>'.$team_title.'</sup></i>';
echo '</figcaption>';
echo '<span class="view-bio">View Bio <i class="icon-chevron-right"></i></span>';
echo '<span class="team-overlay"></span>';
echo '</a>';
echo '</figure>';
echo '</div>';
//echo modal
echo '<div class="modal fade" id="' . $item->post_name . '">';
echo '<div class="modal-body">';
echo '<div class="row">';
echo '<div class="span4">';
echo '<img src="'.$photo[0].'" alt="' .$item->post_title. 's">';
echo '</div>';
echo '<div class="span8">';
echo '<a class="close no-ajaxy" data-dismiss="modal">X</a>';
echo '<h1>'.$item->post_title.', <small><i>'.$team_title.'</i></small></h1>';
echo '<div class="scroll-pane">';
echo apply_filters( 'the_content' , $item->post_content );
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
};
示例15: get_portfolio_grid_image
function get_portfolio_grid_image($item)
{
global $portfolio, $post, $msd_portfolio_url;
$portfolio->the_meta($item->ID);
$youtube = $portfolio->get_the_value('youtube');
if ($youtube != '') {
if (class_exists('MultiPostThumbnails') && ($post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id('msd_portfolio', 'grid-image', $item->ID))) {
$featured_image = wp_get_attachment_image_src($post_thumbnail_id, 'portfolio', false, $attr);
$featured_image = $featured_image[0];
} else {
preg_match('/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/i', $youtube, $matches);
$videoid = $matches[2];
$featured_image = 'http://img.youtube.com/vi/' . $videoid . '/0.jpg';
}
} else {
if (class_exists('MultiPostThumbnails') && ($post_thumbnail_id = MultiPostThumbnails::get_post_thumbnail_id('msd_portfolio', 'grid-image', $item->ID))) {
$featured_image = wp_get_attachment_image_src($post_thumbnail_id, 'portfolio', false, $attr);
$featured_image = $featured_image[0];
} else {
$featured_image = featured_image($item->ID, 'portfolio');
$featured_image = $featured_image[0];
}
}
return $featured_image;
}