示例#1
1
 public function get_image_url($type, $post_id, $size = null)
 {
     if (class_exists('MultiPostThumbnails')) {
         return \MultiPostThumbnails::get_post_thumbnail_url($this->id, $type, $post_id, $size);
     }
     return null;
 }
示例#2
0
 public function widget($args, $instance)
 {
     extract($args);
     $title = $instance['title'];
     echo $before_widget;
     if (!empty($title)) {
         echo '<h3 class="widget-title">' . $title . '</h3>';
     }
     echo class_exists('MultiPostThumbnails') ? MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'flyer') : get_the_post_thumbnail();
     echo $after_widget;
 }
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;
}
    post_class();
    ?>
>
            <header class="entry-header">
 
                <!-- Display featured image in right-aligned floating div -->
                <div class="studentPhoto">
	            <a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    echo esc_attr(sprintf(__('Permalink to %s', 'twentytwelve'), the_title_attribute('echo=0')));
    ?>
" rel="bookmark"><?php 
    if (class_exists('MultiPostThumbnails')) {
        MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image');
    }
    ?>
</a>
            </div>
 
                <!-- Display Title and Author Name -->
                <strong>Title: </strong><a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    echo esc_attr(sprintf(__('Permalink to %s', 'twentytwelve'), the_title_attribute('echo=0')));
    ?>
" rel="bookmark"><?php 
    the_title();
    ?>
示例#5
0
        } else {
            echo 'span_12';
        }
        ?>
">
						
						<?php 
        if (!post_password_required()) {
            $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);
            //Gallery
            if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide') || !empty($enable_gallery_slider) && $enable_gallery_slider == 'on') {
                if (floatval(get_bloginfo('version')) < "3.6") {
                    if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                        nectar_gallery($post->ID);
                    }
                } else {
                    if (!empty($enable_gallery_slider) && $enable_gallery_slider == 'on') {
                        $gallery_ids = grab_ids_from_gallery();
                        ?>
									
										<div class="flex-gallery"> 
											 <ul class="slides">
											 	<?php 
                        foreach ($gallery_ids as $image_id) {
                            echo '<li>' . wp_get_attachment_image($image_id, '', false) . '</li>';
                        }
                        ?>
									    	</ul>
示例#6
0
}
?>
				<p class="summary"><?php 
echo $business_1_summary;
?>
</p>

				<div class="sold-text">
					<p><?php 
echo $sold_text;
?>
</p>
				</div>

				<?php 
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'secondary-image', null)) {
    ?>
					<?php 
    get_template_part('includes/post-formats/tombstone-secondary-logo');
    ?>
				<?php 
} else {
    ?>
					<div class="business-logo business-name">
						<span><?php 
    echo $business_2_name;
    ?>
</span>
					</div>
				<?php 
}
<section class="level-2">
  <div class="row">
    <div class="medium-8 columns package-category-listing ">
      <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
      <h1><?php 
        the_title();
        ?>
</h1>
      <?php 
        if (class_exists('MultiPostThumbnails')) {
            MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'landing-page-image');
        }
        ?>

      <div class="package-intro"><?php 
        the_content();
        ?>
</div>
      <p><?php 
        edit_post_link();
        ?>
</p>
      <hr>
      <?php 
    }
}
示例#8
0
function kite_get_secondary_background_image($default)
{
    if (class_exists('MultiPostThumbnails')) {
        if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'background-image')) {
            return MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'background-image');
        } else {
            return $default;
        }
    } else {
        return $default;
    }
}
示例#9
0
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>';
};
示例#10
0
					<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
    }
    the_content();
}
?>
				</p>
			</div>
		</div>
		<div class="col-md-3">
			<?php 
add_image_size('custom-size', 263, 263);
if (class_exists('MultiPostThumbnails')) {
    MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-2', NULL, 'custom-size');
}
?>
		</div>
	</div>
</section>
<section class="why">
	<div class="container">
		<div class="row" style="border-bottom:1px dotted #ccc">
			<?php 
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$wp_query = new WP_Query(array('post_type' => 'post', 'showposts' => '8', 'paged' => $paged, 'order' => 'ASC'));
if ($wp_query->have_posts()) {
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        ?>
示例#11
0
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') {
                    ?>
						<div class="audio-wrap">		
							<?php 
                    if ($wp_version < "3.6") {
                        nectar_audio($post->ID);
                    } else {
                        $audio_mp3 = get_post_meta($post->ID, '_nectar_audio_mp3', true);
                        $audio_ogg = get_post_meta($post->ID, '_nectar_audio_ogg', true);
                        if (!empty($audio_ogg) || !empty($audio_mp3)) {
                            $audio_output = '[audio ';
                            if (!empty($audio_mp3)) {
                                $audio_output .= 'mp3="' . $audio_mp3 . '" ';
                            }
                            if (!empty($audio_ogg)) {
                                $audio_output .= 'ogg="' . $audio_ogg . '"';
                            }
                            $audio_output .= ']';
                            echo do_shortcode($audio_output);
                        }
                    }
                    ?>
						</div><!--/audio-wrap-->
					<?php 
                } else {
                    if (get_post_format() == 'gallery') {
                        if ($wp_version < "3.6") {
                            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                                nectar_gallery($post->ID);
                            } else {
                                if (has_post_thumbnail()) {
                                    echo get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                                }
                            }
                        } else {
                            $gallery_ids = grab_ids_from_gallery();
                            ?>
				
							<div class="flex-gallery"> 
									 <ul class="slides">
									 	<?php 
                            foreach ($gallery_ids as $image_id) {
                                echo '<li>' . wp_get_attachment_image($image_id, 'portfolio-thumb', false) . '</li>';
                            }
                            ?>
							    	</ul>
						   	 </div><!--/gallery-->

				   <?php 
                        }
                    } else {
                        if (has_post_thumbnail()) {
                            echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => '')) . '</a>';
                        }
                    }
                }
            }
            ?>

				<div class="post-header">
					<h3 class="title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>	
					<span class="meta-author"><?php 
            the_author_posts_link();
            ?>
 </span> <span class="meta-category"> | <?php 
            the_category(', ');
            ?>
 </span> <span class="meta-comment-count"> | <a href="<?php 
            comments_link();
            ?>
">
					<?php 
            comments_number(__('No Comments', NECTAR_THEME_NAME), __('One Comment', NECTAR_THEME_NAME), '% ' . __('Comments', NECTAR_THEME_NAME));
            ?>
</a> </span>
				</div><!--/post-header-->
				
				<?php 
            the_excerpt();
            ?>
				
			</div><!--/span_3-->
			
			<?php 
        }
    }
    wp_reset_postdata();
    ?>
	
		</div><!--/blog-recent-->
	
	<?php 
    wp_reset_query();
    $recent_posts_content = ob_get_contents();
    ob_end_clean();
    return $recent_posts_content;
}
示例#12
0
<?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>
示例#13
0
 </div>
 <div class="container">
     <div class="row">
         <div class="main-container flex flex-column flex-j-center">
             <div class="single-image flex flex-j-center">
                 <?php 
 if (class_exists('MultiPostThumbnails')) {
     MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-3');
 }
 ?>
             </div>
             <div class="main-container flex flex-j-center">
                 <div class="single-image flex flex-j-center">
                     <?php 
 if (class_exists('MultiPostThumbnails')) {
     MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-4');
 }
 ?>
                 </div>
             </div>
         </div>
     </div>
     <div class="page-links flex flex-j-between flex-j-end">
         <div class="previous">
             <?php 
 previous_post_link();
 ?>
         </div>
         <div class="next">
             <?php 
 next_post_link();
 /**
  * Retrieve the source of an image added through multiple post thumbnails.
  *
  * @param string $type Type of thumbnail being requested.
  * @param string $size Size of thumbnail being requested.
  *
  * @return bool|string URL of the image if available. False if not.
  */
 public function get_thumbnail_image_src($type, $size = null)
 {
     if (class_exists('MultiPostThumbnails')) {
         return MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), $type, get_the_ID(), $size);
     }
     return false;
 }
 */
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') {
示例#16
0
        /**
         * Output the metabox with the media modal chooser
         * 
         * @global type $_wp_additional_image_sizes
         * @param type $post 
         */
        public function thumbnail_meta_box_modal($post)
        {
            global $_wp_additional_image_sizes;
            ?>
<style>
                #select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
 {overflow: hidden; padding: 4px 0;}
                #select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
 .remove {display: none; margin-top: 10px; }
                #select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
.has-featured-image .remove { display: inline-block; }
                #select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
 a { clear: both; float: left; }
                #select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
 img { height: auto; margin-bottom: 10px; max-width: 100%; }
            </style>
            <script type="text/javascript">
            jQuery( function($) {
                var $element     = $('#select-mpt-<?php 
            echo esc_js($this->prefix);
            ?>
'),
                    $thumbnailId = $element.find('input[name="<?php 
            echo esc_js($this->prefix);
            ?>
-thumbnail_id"]'),
                    title        = 'Choose a <?php 
            echo esc_js($this->label);
            ?>
',
                    update       = 'Update <?php 
            echo esc_js($this->label);
            ?>
',
                    Attachment   = wp.media.model.Attachment,
                    frame, setMPTImage;

                setMPTImage = function( thumbnailId ) {
                    var selection;
                    
                    $element.find('img').remove();
                    $element.toggleClass( 'has-featured-image', -1 != thumbnailId );
                    $thumbnailId.val( thumbnailId );
                    
                    if ( frame ) {
                        selection = frame.get('library').get('selection');

                        if ( -1 === thumbnailId )
                            selection.clear();
                        else
                            selection.add( Attachment.get( thumbnailId ) );
                    }
                };

                $element.on( 'click', '.choose, img', function( event ) {
                    event.preventDefault();

                   if ( frame ) {
                        frame.open();
                        return;
                    }
                    
                    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 
        }
示例#17
0
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);
            }
        }
    }
}
示例#18
0
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;
    }
}
示例#19
0
						<?php 
        $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
        echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" alt="" class="tx-colorbox">';
        the_post_thumbnail('imax-single-thumb');
        echo '</a>';
        if (class_exists('MultiPostThumbnails')) {
            $large_image_url1 = wp_get_attachment_image_src(MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'feature-image-2', $post->ID), 'large');
            if ($large_image_url1) {
                echo '<a href="' . $large_image_url1[0] . '" title="' . the_title_attribute('echo=0') . '" class="tx-colorbox">';
                MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-2', NULL, 'imax-single-thumb');
                echo '</a>';
            }
            $large_image_url2 = wp_get_attachment_image_src(MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'feature-image-3', $post->ID), 'large');
            if ($large_image_url2) {
                echo '<a href="' . $large_image_url2[0] . '" title="' . the_title_attribute('echo=0') . '" class="tx-colorbox">';
                MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'feature-image-3', NULL, 'imax-single-thumb');
                echo '</a>';
            }
        }
        ?>
						</div>
						
					</header><!-- .entry-header -->
                    <?php 
    }
    ?>
                    
                    <div class="folio-meta">
                    <?php 
    if (!empty($sub_title)) {
        ?>
示例#20
0
?>
	
			            		<figcaption>
									<?php 
if (dynamic_sidebar('featured-center')) {
}
?>
							
								</figcaption>	
							</figure>													
						</article>	
						<article class="featured-content col-xs-12 col-md-4 col-lg-3 first">							
							<figure class="featured-img">
								<?php 
if (class_exists('MultiPostThumbnails')) {
    MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'third-featured-image');
}
?>
	
			            		<figcaption>
									<?php 
if (dynamic_sidebar('featured-right')) {
}
?>
									
								</figcaption>	
							</figure>													
						</article>																	
					</div>												
				</div> <!-- .index-content .col-xs-12 -->
				<?php 
 /**
  * Enqueue admin JavaScripts
  *
  * @return void
  */
 public function enqueue_admin_scripts($hook)
 {
     if (self::$statics_enqueued) {
         return;
     }
     global $wp_version, $post_ID;
     // only load on select pages
     if (!in_array($hook, array('post-new.php', 'post.php', 'media-upload-popup'))) {
         return;
     }
     if (version_compare($wp_version, '3.5', '<')) {
         add_thickbox();
         wp_enqueue_script("mpt-featured-image", $this->plugins_url('js/multi-post-thumbnails-admin.js', __FILE__), array('jquery', 'media-upload'));
     } else {
         // 3.5+ media modal
         wp_enqueue_media(array('post' => $post_ID ? $post_ID : null));
         wp_enqueue_script("mpt-featured-image", $this->plugins_url('js/multi-post-thumbnails-admin.js', __FILE__), array('jquery', 'set-post-thumbnail'));
         wp_enqueue_script("mpt-featured-image-modal", $this->plugins_url('js/media-modal.js', __FILE__), array('jquery', 'media-models'));
     }
     wp_enqueue_style("mpt-admin-css", $this->plugins_url('css/multi-post-thumbnails-admin.css', __FILE__));
     self::$statics_enqueued = true;
 }
示例#22
0
</h1>
			</div>		

			<div class="col-xs-12 grid">
				<div class="row">
					<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
						
					<div class="col-xs-12 col-sm-4 ">
						<figure class="effect-romeo">
							<?php 
        if (class_exists('MultiPostThumbnails')) {
            MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'portfolio-archive-image');
        }
        ?>
	
							<figcaption>
								<h2>   
									<?php 
        $words = explode(' ', the_title('', '', false));
        $words[1] = '<span>' . $words[1] . '</span>';
        $title = implode(' ', $words);
        echo $title;
        ?>
                                </h2>								
								<p><?php 
        echo excerpt(30);
        ?>
示例#23
0
function ceo_display_comic_thumbnail($thumbnail_size = 'thumbnail', $override_post = null, $size = array())
{
    global $post;
    $thumbnail = $output = '';
    $post_to_use = !empty($override_post) ? $override_post : $post;
    if (class_exists('MultiPostThumbnails') && $thumbnail_size == 'secondary-image' && is_null($override_post)) {
        $thumbnail = MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'secondary-image');
    } else {
        if (!empty($size)) {
            $thumbnail = get_the_post_thumbnail($post_to_use->ID, $size);
        } else {
            $thumbnail = get_the_post_thumbnail($post_to_use->ID, $thumbnail_size);
        }
    }
    if (has_post_thumbnail($post_to_use->ID)) {
        $output = '<a href="' . get_permalink($post_to_use->ID) . '" rel="bookmark" title="' . get_the_title() . '">' . $thumbnail . '</a>' . "\r\n";
    } else {
        //			$output = "No Thumbnail Found.";
    }
    return apply_filters('easel_display_comic_thumbnail', $output);
}
示例#24
0
?>
" title="<?php 
printf(esc_attr__('Permalink to %s', 'magazino'), the_title_attribute('echo=0'));
?>
" rel="bookmark"><?php 
_e('&#9654;', 'magazino');
?>
</a></div>
    
	<?php 
//Checks for plugin..
if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'grid-thumbnail', strval(get_the_ID()))) {
    ?>

    <div class="post-box-img"><?php 
    MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'grid-thumbnail');
    ?>
</div>
      
    <?php 
} else {
    //Plugin not installed
    ?>
    
      <?php 
    //Checks for attached post image instead
    $postimgs =& get_children(array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'exclude' => get_post_thumbnail_id()));
    if (!empty($postimgs)) {
        $firstimg = array_shift($postimgs);
        $th_image = wp_get_attachment_image($firstimg->ID, array(500, 500), false);
        ?>
示例#25
0
    function nectar_gallery($postid)
    {
        if (class_exists('MultiPostThumbnails')) {
            ?>
		   
		  <div class="flex-gallery"> 
		  	  <ul class="slides">
			    <?php 
            if (has_post_thumbnail()) {
                echo '<li>' . get_the_post_thumbnail($postid, 'full', array('title' => '')) . '</li>';
            }
            ?>
			   
			    <?php 
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'second-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'second-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'third-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'third-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'fourth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fourth-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'fifth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'fifth-slide') . '</li>';
            }
            if (MultiPostThumbnails::has_post_thumbnail(get_post_type(), 'sixth-slide')) {
                echo '<li>' . MultiPostThumbnails::get_the_post_thumbnail(get_post_type(), 'sixth-slide') . '</li>';
            }
            ?>
		   	   
		   	   </ul>
		   </div><!--/gallery-->
		<?php 
        }
    }
示例#26
0
    foreach ($term_list as $term) {
        $term_class .= $term->slug . ' ';
    }
    if (get_post_meta($project->ID, 'project_archived', true) != 1) {
        ?>
				<div class="project <?php 
        echo rtrim($term_class, ' ');
        ?>
">
					<a href="<?php 
        echo get_permalink($project->ID);
        ?>
 ">
					<div class="project-thumb" style="background-image: url('<?php 
        if (class_exists('MultiPostThumbnails')) {
            echo MultiPostThumbnails::get_post_thumbnail_url('project', 'menu-image', $project->ID, $display_size);
        }
        ?>
');">
						<div class="module-foreground-rollover" style="background: #<?php 
        echo get_post_meta($project->ID, 'color_space', true);
        ?>
;" >
							<h4><?php 
        echo get_the_title($project->ID);
        ?>
</h4>
						</div>
					</div>
					</a>
				</div>
示例#27
0
					</div>
				</div>
			<?php 
}
?>

			<?php 
if (!empty($productos[2])) {
    ?>
				<div data-sr="enter top, over 1s" class="col-xs-12 col-sm-4 text-center">
					<div class="producto-index">
						<div class="producto-images-box">
							<?php 
    if (class_exists('MultiPostThumbnails')) {
        MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'image-1', $post_id = $productos[2], 'part3-1');
        MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'image-2', $post_id = $productos[2], 'part3-2');
    }
    ?>
							<a class="btn btn-warning btn-md text-uppercase" role="button"><?php 
    echo get_the_title($productos[2]);
    ?>
</a>
						</div>
					</div>
				</div>
			<?php 
}
?>

			
		</div>
示例#28
0
				<?php 
        if ($links_disabled) {
            ?>
											
		    		<?php 
            MultiPostThumbnails::the_post_thumbnail($post_type, 'slidewhow_image', NULL, 'ttrust_slideshow_image_full');
            ?>
							
				<?php 
        } else {
            ?>
					<a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" ><?php 
            MultiPostThumbnails::the_post_thumbnail($post_type, 'slidewhow_image', NULL, 'ttrust_slideshow_image_full');
            ?>
</a>	
				<?php 
        }
        ?>
				<?php 
        if ($slide_text) {
            ?>
					<div class="flex-caption">
						<p><?php 
            echo $slide_text;
            ?>
</p>
					</div>
				<?php 
示例#29
0
            ?>
<a href="<?php 
            echo $link_to;
            ?>
"><?php 
        }
        ?>
					<div class="grid-element <?php 
        echo rtrim($term_class, ' ');
        ?>
">
						<div class="grid-image" style="background-image:url('<?php 
        echo wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        ?>
');" onmouseover="swapBackground(this,'<?php 
        echo MultiPostThumbnails::get_post_thumbnail_url('post', 'rollover-image', $post->ID);
        ?>
');" onmouseout="swapBackground(this,'<?php 
        echo wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        ?>
');"></div>
						<p><b><?php 
        $bev = get_the_category($post->ID);
        echo $bev[0]->name;
        ?>
 / </b><?php 
        echo $post->post_title;
        ?>
</p>
					</div>
				<?php 
示例#30
0
						<?php 
        // ADD DUAL IMAGE IF APPROPRIATE
        if (get_post_meta($module->ID, 'module_size', true) == 'dual-small' || get_post_meta($module->ID, 'module_size', true) == 'dual-medium' || get_post_meta($module->ID, 'module_size', true) == 'dual-large') {
            ?>
						<div class="module-background-image">
							<img id="background-image-<?php 
            echo get_post_meta($module->ID, 'module_id', true);
            ?>
" class="scroll_load" src="<?php 
            if (class_exists('MultiPostThumbnails')) {
                echo MultiPostThumbnails::get_post_thumbnail_url('project', 'background-rollover-image', get_post_meta($module->ID, 'module_id', true), 'xsmall');
            }
            ?>
" />
							<?php 
            $images_script .= '"background-image-' . get_post_meta($module->ID, 'module_id', true) . '":"' . MultiPostThumbnails::get_post_thumbnail_url('project', 'background-rollover-image', get_post_meta($module->ID, 'module_id', true), $display_size) . '", ';
            ?>
						</div>
						<?php 
        }
        ?>
						
						<?php 
        if ($block_link) {
            ?>
</a><?php 
        }
        ?>
					</div>
					
					<?php